缓存支持读取缓存key的剩余有效时间
This commit is contained in:
@ -26,6 +26,8 @@ type ResultParseFunc func(res string) error
|
||||
type ICache interface {
|
||||
// Exist 缓存是否存在
|
||||
Exist(ctx context.Context, cacheInstanceFlag string, key string) (bool, error)
|
||||
// TTL key还有多长时间过期
|
||||
TTL(ctx context.Context, cacheInstanceFlag string, key string) (int64, error)
|
||||
// Set 设置缓存
|
||||
Set(ctx context.Context, cacheInstanceFlag string, key string, value string, ttl int64) error
|
||||
// Get 读取原始缓存数据
|
||||
|
Reference in New Issue
Block a user