Documentation ¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func (*RedisCache) Del ¶
func (r *RedisCache) Del(key string) (bool, error)
Del 软删除, 就是设置一下状态为 invalidCacheCode
func (*RedisCache) Get ¶
Get 如果缓存不存在, 执行 set key value ex nx, 如果缓存是 invalidCacheCode, 执行 set key value ex 如果缓存无效或不存在, 会执行传入的函数去获取数据, 然后存到缓存
func (*RedisCache) MGet ¶
func (r *RedisCache) MGet(keys ...string) ([]interface{}, error)
MGet 批量获取
Click to show internal directories.
Click to hide internal directories.