Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisLock ¶
type RedisLock struct {
// contains filtered or unexported fields
}
RedisLock is a redis SET NX based lock
func New ¶
func New(cli redislock.RedisClient, key string, waitTimeout, lockTTL time.Duration) (*RedisLock, error)
New creates a lock key: name of the lock waitTimeout: timeout before getting the lock, Lock returns error if the lock is not acquired after this time lockTTL: ttl of lock, after this time, lock will be released automatically
Click to show internal directories.
Click to hide internal directories.