调整目录位置和变量名

This commit is contained in:
ayflying
2024-12-23 16:15:27 +08:00
parent 3190e4328e
commit a90e22c242
7 changed files with 11 additions and 63 deletions

18
aycache/redis.go Normal file
View File

@@ -0,0 +1,18 @@
package aycache
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gcache"
)
var adapterRedisClient gcache.Adapter
var adapterRedisCache = gcache.New()
func NewAdapterRedis() gcache.Adapter {
if adapterRedisClient == nil {
adapterRedisClient = gcache.NewAdapterRedis(g.Redis("cache"))
adapterRedisCache.SetAdapter(adapterRedisClient)
}
return adapterRedisCache
}