Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseLock ¶
type BaseLock struct {
// contains filtered or unexported fields
}
BaseLock 锁的模板
func NewBaseLock ¶
type Config ¶
type Config struct { Addr string // redis地址 LeaseTime time.Duration // 锁过期时间 WaitTime time.Duration // 加锁等待时间 }
Config 配置
type FairLock ¶
type FairLock struct { *ReentrantLock // contains filtered or unexported fields }
type ReentrantLock ¶
type ReentrantLock struct {
// contains filtered or unexported fields
}
func NewReentrantLock ¶
func NewReentrantLock(client *redis.Client, resource, lockName string, leaseTime time.Duration) *ReentrantLock
Click to show internal directories.
Click to hide internal directories.