• Stars
    star
    149
  • Rank 248,619 (Top 5 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created almost 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This project encapsulates multiple db servers, redis、ledis、memcache、file、memory、nosql、postgresql

go-cache

This project encapsulates multiple db servers, redis、ledis、memcache、file、memory、nosql、postgresql

example

package main

import (
	"github.com/huntsman-li/go-cache"
	_ "github.com/huntsman-li/go-cache/redis"
)

func main() {
	ca, err := cache.Cacher(cache.Options{
		Adapter:       "redis",
		AdapterConfig: "addr=127.0.0.1:6379",
		OccupyMode:    true,
	})

	if err != nil {
		panic(err)
	}

	ca.Put("liyan", "cache", 60)
}