Documentation ¶
Index ¶
- type Config
- type Locker
- func (l *Locker) LockForKey(key string, expiry time.Duration) (*redsync.Mutex, error)
- func (l *Locker) LockForKeyWithNoRetry(key string, expiry time.Duration) (*redsync.Mutex, error)
- func (l *Locker) LockForKeyWithRetry(key string, expiry time.Duration, retry int) (*redsync.Mutex, error)
- func (l *Locker) LockForKeyWithRetryDelay(key string, expiry time.Duration, retry int, retryDelay time.Duration) (*redsync.Mutex, error)
- func (l *Locker) Unlock(key string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // RedisAddress address for redis RedisAddress []string `yaml:"redis-address" json:"redisAddress,omitempty"` }
Config for redis config locker
type Locker ¶
type Locker struct {
// contains filtered or unexported fields
}
Locker gloable locker
func (*Locker) LockForKey ¶ added in v1.0.1
LockForKey lock for special key
func (*Locker) LockForKeyWithNoRetry ¶
LockForKeyWithNoRetry lock for special key
func (*Locker) LockForKeyWithRetry ¶
func (l *Locker) LockForKeyWithRetry(key string, expiry time.Duration, retry int) (*redsync.Mutex, error)
LockForKeyWithRetry lock for special key
Click to show internal directories.
Click to hide internal directories.