Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type InitOptions ¶
type InitOptions struct { Prefix string // redis键值前缀 RedisServer string // redis服务器信息 Password string // redis密码 }
InitOptions 分布式锁参数
type Locker ¶
type Locker interface { Lock() error RefreshTTL() error Unlock() error TTL() (time.Duration, error) }
Locker 分布式锁接口
type Options ¶
type Options struct { TTL time.Duration // 锁的存活时间 Timeout time.Duration // 上锁超时时间 AutoRefreshTTL bool // 是否自动刷新锁的存活时间 Retry RetryStrategy // 重试策略 Ctx context.Context }
Options 分布式锁参数
type RetryStrategy ¶
RetryStrategy 重试策略
Click to show internal directories.
Click to hide internal directories.