修改路径

This commit is contained in:
ayflying
2025-02-28 17:45:44 +08:00
parent 9f337df9de
commit 74a746bc47
29 changed files with 7 additions and 7 deletions

37
package/aycache/cache.go Normal file
View File

@@ -0,0 +1,37 @@
package aycache
import (
"github.com/ayflying/utility_go/package/aycache/drive"
"github.com/gogf/gf/v2/os/gcache"
)
type Mod struct {
client *gcache.Cache
}
//func NewV1(_name ...string) *cache.Mod {
// return pgk.Cache
//}
func New(_name ...string) gcache.Adapter {
var cacheAdapterObj gcache.Adapter
var name = "cache"
if len(_name) > 0 {
name = _name[0]
}
switch name {
case "cache":
cacheAdapterObj = NewAdapterMemory()
case "redis":
cacheAdapterObj = NewAdapterRedis()
case "file":
cacheAdapterObj = NewAdapterFile("runtime/cache")
case "es":
cacheAdapterObj = drive.NewAdapterElasticsearch([]string{"http://127.0.0.1:9200"})
}
//var client = gcache.New()
//client.SetAdapter(cacheAdapterObj)
return cacheAdapterObj
}