Versions in this module Expand all Collapse all v1 v1.12.2 Dec 24, 2020 v1.12.1 Dec 8, 2020 Changes in this version + var DefaultEvery = 60 + var FileCacheDirectoryLevel = 2 + var FileCacheEmbedExpiry time.Duration + var FileCacheFileSuffix = ".bin" + var FileCachePath = "cache" + func FileGetContents(filename string) (data []byte, e error) + func FilePutContents(filename string, content []byte) error + func GetBool(v interface{}) bool + func GetFloat64(v interface{}) float64 + func GetInt(v interface{}) int + func GetInt64(v interface{}) int64 + func GetString(v interface{}) string + func GobDecode(data []byte, to *FileCacheItem) error + func GobEncode(data interface{}) ([]byte, error) + func Register(name string, adapter Instance) + type Cache interface + ClearAll func() error + Decr func(key string) error + Delete func(key string) error + Get func(key string) interface{} + GetMulti func(keys []string) []interface{} + Incr func(key string) error + IsExist func(key string) bool + Put func(key string, val interface{}, timeout time.Duration) error + StartAndGC func(config string) error + func NewCache(adapterName, config string) (adapter Cache, err error) + func NewFileCache() Cache + func NewMemoryCache() Cache + type FileCache struct + CachePath string + DirectoryLevel int + EmbedExpiry int + FileSuffix string + func (fc *FileCache) ClearAll() error + func (fc *FileCache) Decr(key string) error + func (fc *FileCache) Delete(key string) error + func (fc *FileCache) Get(key string) interface{} + func (fc *FileCache) GetMulti(keys []string) []interface{} + func (fc *FileCache) Incr(key string) error + func (fc *FileCache) Init() + func (fc *FileCache) IsExist(key string) bool + func (fc *FileCache) Put(key string, val interface{}, timeout time.Duration) error + func (fc *FileCache) StartAndGC(config string) error + type FileCacheItem struct + Data interface{} + Expired time.Time + Lastaccess time.Time + type Instance func() Cache + type MemoryCache struct + Every int + func (bc *MemoryCache) ClearAll() error + func (bc *MemoryCache) Decr(key string) error + func (bc *MemoryCache) Delete(name string) error + func (bc *MemoryCache) Get(name string) interface{} + func (bc *MemoryCache) GetMulti(names []string) []interface{} + func (bc *MemoryCache) Incr(key string) error + func (bc *MemoryCache) IsExist(name string) bool + func (bc *MemoryCache) Put(name string, value interface{}, lifespan time.Duration) error + func (bc *MemoryCache) StartAndGC(config string) error + type MemoryItem struct