README ¶ 基于Redis的分布式锁 参考: https://github.com/rfyiamcool/go_redis_lock/blob/master/lock.go Expand ▾ Collapse ▴ Documentation ¶ Index ¶ type EtcdLock type Lock func NewLock() Lock type RedisLock func NewRedisLock(client *redis.Client, token, resource string, retries, interval int) *RedisLock func (rl *RedisLock) Acquire() error func (rl *RedisLock) Release() error type ZookeeperLock Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type EtcdLock ¶ type EtcdLock struct { } type Lock ¶ type Lock interface { Acquire() error Release() error } func NewLock ¶ func NewLock() Lock type RedisLock ¶ type RedisLock struct { // contains filtered or unexported fields } func NewRedisLock ¶ func NewRedisLock(client *redis.Client, token, resource string, retries, interval int) *RedisLock func (*RedisLock) Acquire ¶ func (rl *RedisLock) Acquire() error func (*RedisLock) Release ¶ func (rl *RedisLock) Release() error type ZookeeperLock ¶ type ZookeeperLock struct { } 支持其他形式实现的锁 Source Files ¶ View all Source files distributed_lock.go Click to show internal directories. Click to hide internal directories.