Categorygithub.com/threeq/lockx
modulepackage
0.0.0-20220511053805-d8a2942c7d1c
Repository: https://github.com/threeq/lockx.git
Documentation: pkg.go.dev

# README

lockx

分布式锁

TODO

  • 分布式对写锁

# Packages

No description provided by the author

# Functions

ExponentialBackoff strategy is an optimization strategy with a retry time of 2**n milliseconds (n means number of times).
No description provided by the author
Key 锁 id.
LimitRetry limits the number of retries to max attempts.
LinearBackoff allows retries regularly with customized intervals.
No description provided by the author
No description provided by the author
NewLocalLockerFactory 获取本地所工厂,单例模式.
NewRedisLockerFactory 新建 redis 分布式锁工厂.
NoRetry acquire the lock only once.
Retry 锁重试次数.
No description provided by the author
TTL 锁过期时间.

# Variables

ErrLockNotHeld is returned when trying to release an inactive lock.
ErrNotObtained is returned when a lock cannot be obtained.
ErrNotSupport is returned when trying to release an inactive lock.

# Structs

LocalLockerFactory 本地锁工厂.
LockerMeta 锁配置元数据.
RedisLockerFactory 分布式工厂锁实现.

# Interfaces

Locker 锁接口.
LockerFactory 锁创建工厂实现接口.
RedisClient is a minimal client interface.
RetryStrategy allows to customise the lock retry strategy.
RWLocker 读写锁接口.

# Type aliases

Option 锁配置元数据设置.