Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache interface {
Has(k string) Reply // 是否存在
Set(k string, v interface{}) Reply // 设置键值
SetX(k string, v interface{}, d time.Duration) Reply // 设置键值并设置过期时长
SetN(k string, v interface{}) Reply // 设置键值存在时返回错误
SetNX(k string, v interface{}, d time.Duration) Reply // 设置键值并设置过期时长,如果存在则返回错误
Del(k string) Reply // 删除键值(不存在为成功)
DelExpired(k string) Reply // 删除过期键值(不存在为成功)
Get(k string) Reply // 获取键值
GetDel(k string) Reply // 获取并删除键值
GetSet(k string, v interface{}) Reply // 获取并设置新的键值
GetSetX(k string, v interface{}, d time.Duration) Reply // 获取并设置新的键值和过期时长
Expire(k string, d time.Duration) Reply // 设置新的过期时间
Dur(k string) Reply // 获取过期时间
Len(f RangeFunc) Reply // 遍历键
Range(f RangeFunc) Reply // 遍历键值
}
Cache 字典缓存器
Click to show internal directories.
Click to hide internal directories.