Documentation ¶
Index ¶
- func Init(cacheSwitch string)
- type Cache
- func (c *Cache) Contains(key string) bool
- func (c *Cache) Delete(Key string) error
- func (c *Cache) DeleteMulti(keys []string) error
- func (c *Cache) Fetch(key string) (string, error)
- func (c *Cache) FetchMulti(keys []string) map[string]string
- func (c *Cache) Flush() error
- func (c *Cache) Save(key, value string) error
- func (c *Cache) SaveByTime(key, value string, lifeTime time.Duration) error
- func (c *Cache) SaveMulti(kvs map[string]string) error
- func (c *Cache) SaveMultiByTime(kvs map[string]string, lifeTime time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
var ( RedisAddr = "0.0.0.0:123" GlobalCache *Cache // 全局缓存 )
func (*Cache) FetchMulti ¶
FetchMulti 批量获取缓存中的键值对
func (*Cache) SaveByTime ¶
SaveByTime 按照自定义时间保存键值对到缓存中
Click to show internal directories.
Click to hide internal directories.