Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LockExpiry time.Duration = 60 * time.Second LockRetryDelay time.Duration = 100 * time.Millisecond LockExtendDelay time.Duration = 333 * time.Millisecond LockDriftFactor float64 = 0.01 LockTimeoutFactor float64 = 0.05 )
View Source
var ErrExtendFailed = errors.New("redsync: failed to extend lock")
View Source
var ErrTaken = errors.New("lock already taken")
Functions ¶
func AcquireRedisPool ¶
func AcquireRedisPool( clients []*goredislib.Options, ) []redis.Pool
Types ¶
type ErrNodeTaken ¶
type ErrNodeTaken struct {
Node int
}
ErrNodeTaken is the error resulting if the lock is already taken in one of the cluster's nodes
func (ErrNodeTaken) Error ¶
func (err ErrNodeTaken) Error() string
type Lock ¶
type Lock struct {
*lock.LockOptions
// contains filtered or unexported fields
}
type LockManager ¶
type LockManager struct {
// contains filtered or unexported fields
}
func NewLockManager ¶
func (*LockManager) Health ¶
func (lm *LockManager) Health(ctx context.Context) (conditions []string, err error)
func (*LockManager) NewLock ¶
func (lm *LockManager) NewLock(key string, opt ...lock.LockOption) lock.Lock
type RedisError ¶
A RedisError is an error communicating with one of the Redis nodes.
func (RedisError) Error ¶
func (err RedisError) Error() string
Click to show internal directories.
Click to hide internal directories.