Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache interface {
ListKey(*ListKeyRequest) (*ListKeyResponse, error)
// SetDefaultTTL 设置默认过期时间.
SetDefaultTTL(ttl time.Duration)
// Put 添加缓存, 并设置key的默认过期时间.
Put(key string, val interface{}) error
// PutWithTTL 添加缓存, 并指定过期时间.
PutWithTTL(key string, val interface{}, ttl time.Duration) error
// Get 通过key获取缓存.
Get(key string, val interface{}) error
// Delete 通过key删除缓存.
Delete(key string) error
// IsExist 检查名为key的缓存是否存在.
IsExist(key string) bool
// ClearAll 清理所有缓存.
ClearAll() error
// Incr 增加名为key的缓存的值, 和count类似.
Incr(key string) error
// Decr 减少名为key的缓存的值, 和count类似.
Decr(key string) error
// Close 关闭缓存.
Close() error
// 携带上下文
WithContext(ctx context.Context) Cache
}
Cache 缓存接口.
type ListKeyRequest ¶
type ListKeyRequest struct {
*request.PageRequest
// contains filtered or unexported fields
}
ListKeyRequest todo
func NewListKeyRequest ¶
func NewListKeyRequest(pattern string, ps uint, pn uint) *ListKeyRequest
NewListKeyRequest todo
type ListKeyResponse ¶
ListKeyResponse todo
func NewListKeyResponse ¶
func NewListKeyResponse(keys []string, total uint64) *ListKeyResponse
NewListKeyResponse todo
Click to show internal directories.
Click to hide internal directories.