Fetch the repository succeeded.
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
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。