Documentation ¶
Overview ¶
Package key redis的key包装
Package key redis的key包装
Index ¶
- Variables
- type ClientKey
- func (k *ClientKey) AutoRefresh() error
- func (k *ClientKey) Delete(ctx context.Context) error
- func (k *ClientKey) Exists(ctx context.Context) (bool, error)
- func (k *ClientKey) RefreshTTL(ctx context.Context) error
- func (k *ClientKey) StopAutoRefresh(force bool) error
- func (k *ClientKey) TTL(ctx context.Context) (time.Duration, error)
- func (k *ClientKey) Type(ctx context.Context) (string, error)
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
var ErrAutoRefreshTaskHNotSetYet = errors.New("自动刷新任务未启动")
ErrAutoRefreshTaskHNotSetYet 自动刷新任务未启动
var ErrAutoRefreshTaskHasBeenSet = errors.New("已经启动了自动刷新任务")
ErrAutoRefreshTaskHasBeenSet 已经启动了自动刷新任务
var ErrAutoRefreshTaskInterval = errors.New("未设置自动刷新任务的间隔")
ErrAutoRefreshTaskInterval 未设置自动刷新任务的间隔
var ErrKeyNotExist = errors.New("key不存在")
ErrKeyNotExist key不存在
var ErrKeyNotSetExpire = errors.New("key没有设置过期")
ErrKeyNotSetExpire key没有设置过期
var ErrKeyNotSetMaxTLL = errors.New("key没有设置最大tll")
ErrKeyNotSetMaxTLL key没有设置最大tll
var ErrParamDelimiterLengthMustLessThan2 = errors.New("不定长参数delimiter长度必须小于2")
ErrParamDelimiterLengthMustLessThan2 不定长参数delimiter长度必须小于2
Functions ¶
This section is empty.
Types ¶
type ClientKey ¶
type ClientKey struct { Key string Opt Options Client redis.UniversalClient // contains filtered or unexported fields }
ClientKey 描述任意一种的单个key对象
func New ¶
New 创建一个新的key对象 @params client redis.UniversalClient 客户端对象 @params key string bitmap使用的key @params opts ...*KeyOption key的选项
func (*ClientKey) RefreshTTL ¶
RefreshTTL 刷新key的生存时间 @params ctx context.Context 上下文信息,用于控制请求的结束
func (*ClientKey) StopAutoRefresh ¶
StopAutoRefresh 取消自动更新缓存 @params force bool 强制停下整个定时任务cron对象
type Option ¶
type Option interface {
Apply(*Options)
}
Option configures how we set up the connection.
func WithAutoRefreshInterval ¶
WithAutoRefreshInterval 设置自动刷新过期时间的设置
Directories ¶
Path | Synopsis |
---|---|
Package clientkeybatch redis的keybatch包装
|
Package clientkeybatch redis的keybatch包装 |