3 Star 15 Fork 1

Walle/ewa

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
cache.go 736 Bytes
Copy Edit Raw Blame History
JackHunx authored 2022-05-26 17:15 +08:00 . change Gf v2.0
package cache
import (
"gitee.com/wallesoft/ewa/kernel/cache/adapter"
"github.com/gogf/gf/v2/os/gcache"
"github.com/gogf/gf/v2/os/gfile"
)
// type Cache interface {
// Get(key string) interface{}
// Set(key string, val interface{}, duration time.Duration)
// Contains(key string) bool
// Remove(key string) error
// }
//DefaultCache is alias of gcache.Cache
// type DefaultCache struct {
// *gcache.Cache
// }
var defaultCache = New("ewawechat")
func New(dir ...string) *gcache.Cache {
tmp := gfile.Temp() + "/"
if len(dir) > 0 {
tmp = gfile.Temp() + "/" + dir[0] + "/"
}
cache := gcache.New()
adapter := adapter.New(tmp)
cache.SetAdapter(adapter)
return cache
}
func Get() *gcache.Cache {
return defaultCache
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/wallesoft/ewa.git
git@gitee.com:wallesoft/ewa.git
wallesoft
ewa
ewa
77647f8410d3

Search