Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrorLockOccupied = errors.New("lock is occupied")
)
Functions ¶
Types ¶
type ILocker ¶
type ILocker interface { // Lock 获得锁 Lock(key string) error // UnLock 释放锁 UnLock(key string) error }
ILocker 锁约定
func NewDistributedRedisLock ¶
func NewDistributedRedisLock(client *redis.Client) ILocker
NewDistributedRedisLock 创建分布式 redis 锁
type ILockerTimeout ¶
ILockerTimeout 锁超时约定
Click to show internal directories.
Click to hide internal directories.