Versions in this module Expand all Collapse all v1 v1.0.5 Oct 11, 2022 Changes in this version + var ErrExtendFailed = errors.New("redsync: failed to extend lock") + var ErrFailed = errors.New("redsync: failed to acquire lock") + type DelayFunc func(tries int) time.Duration + type Mutex struct + func (m *Mutex) Extend() (bool, error) + func (m *Mutex) ExtendContext(ctx context.Context) (bool, error) + func (m *Mutex) Lock() error + func (m *Mutex) LockContext(ctx context.Context) error + func (m *Mutex) Name() string + func (m *Mutex) SetDelayFunc(f DelayFunc) + func (m *Mutex) SetDriftFactor(v float64) + func (m *Mutex) SetExpiry(t time.Duration) + func (m *Mutex) SetTimeoutFactor(v float64) + func (m *Mutex) SetTries(ties int) + func (m *Mutex) Unlock() (bool, error) + func (m *Mutex) UnlockContext(ctx context.Context) (bool, error) + func (m *Mutex) Until() time.Time + func (m *Mutex) Valid() (bool, error) + func (m *Mutex) ValidContext(ctx context.Context) (bool, error) + func (m *Mutex) Value() string + type Option interface + Apply func(*Mutex) + func WithDriftFactor(factor float64) Option + func WithExpiry(expiry time.Duration) Option + func WithGenValueFunc(genValueFunc func() (string, error)) Option + func WithRetryDelay(delay time.Duration) Option + func WithRetryDelayFunc(delayFunc DelayFunc) Option + func WithTimeoutFactor(factor float64) Option + func WithTries(tries int) Option + func WithValue(v string) Option + type OptionFunc func(*Mutex) + func (f OptionFunc) Apply(mutex *Mutex) + type Redsync struct + func New(pools ...redis.Pool) *Redsync + func (r *Redsync) NewMutex(name string, options ...Option) *Mutex