Adapters for package gcache.
gf version >= v1.14.0
Or using the
master
branch.
go get -u github.com/gogf/gcache-adapter
import "github.com/gogf/gcache-adapter/adapter"
cache := gcache.New()
adapter := adapter.NewRedis(g.Redis())
cache.SetAdapter(adapter)
adapter := adapter.NewRedis(g.Redis())
g.DB().GetCache().SetAdapter(adapter)