Versions in this module Expand all Collapse all v2 v2.0.0 May 31, 2022 Changes in this version + var ErrAutoRefreshTaskHNotSetYet = errors.New("自动刷新任务未启动") + var ErrAutoRefreshTaskHasBeenSet = errors.New("已经启动了自动刷新任务") + var ErrAutoRefreshTaskInterval = errors.New("未设置自动刷新任务的间隔") + var ErrKeyNotExist = errors.New("key不存在") + var ErrKeyNotSetExpire = errors.New("key没有设置过期") + var ErrKeyNotSetMaxTLL = errors.New("key没有设置最大tll") + var ErrParamDelimiterLengthMustLessThan2 = errors.New("不定长参数delimiter长度必须小于2") + type ClientKey struct + Client redis.UniversalClient + Key string + Opt Options + func New(client redis.UniversalClient, key string, opts ...Option) *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 interface + Apply func(*Options) + func WithAutoRefreshInterval(autoRefreshInterval string) Option + func WithMaxTTL(maxttl time.Duration) Option + func WithTaskCron(taskCron *cron.Cron) Option + type Options struct + AutoRefreshInterval string + MaxTTL time.Duration + TaskCron *cron.Cron Other modules containing this package github.com/Golang-Tools/redishelper