Versions in this module Expand all Collapse all v0 v0.1.2 Nov 5, 2019 v0.1.1 Oct 25, 2019 Changes in this version + var DefaultValidTimeout = 60 + var FileCacheDirectoryLevel = 2 + var FileCacheEmbedExpiry time.Duration + var FileCacheFileSuffix = ".bin" + var FileCachePath = "cache" + 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(adapterName AdapterName, adapter CacheInstance) + type AdapterName string + const CacheFileAdapter + const CacheMemcacheAdapter + const CacheMemoryAdapter + const CacheRedisAdapter + type Cache interface + ClearAll func() error + Delete func(key string) error + Get func(key string) interface{} + GetMulti func(keys []string) []interface{} + IsExist func(key string) bool + Put func(key string, val interface{}, timeout time.Duration) error + StartCache func(config string) error + func NewCache(adapterName AdapterName, config string) (adapter Cache, err error) + func NewFileCache() Cache + func NewMemoryCache() Cache + type CacheInstance func() Cache + type FileCache struct + CachePath string + DirectoryLevel int + EmbedExpired int64 + FileSuffix string + func (fc *FileCache) ClearAll() 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) IsExist(key string) bool + func (fc *FileCache) Put(key string, val interface{}, timeout time.Duration) error + func (fc *FileCache) StartCache(config string) error + type FileCacheItem struct + Data interface{} + Expired time.Time + LastAccess time.Time + type MemoryCache struct + func (mc *MemoryCache) ClearAll() error + func (mc *MemoryCache) Delete(key string) error + func (mc *MemoryCache) Get(key string) interface{} + func (mc *MemoryCache) GetMulti(keys []string) []interface{} + func (mc *MemoryCache) IsExist(key string) bool + func (mc *MemoryCache) Put(key string, value interface{}, lifeSpan time.Duration) error + func (mc *MemoryCache) StartCache(config string) error + type MemoryItem struct