Documentation ¶ Index ¶ type Mutex func New(redis redis.Cmdable, opts ...Option) *Mutex func (m *Mutex) Lock(ctx context.Context, name string) error func (m *Mutex) Unlock(ctx context.Context, name string) error type Option func WithExpired(expired time.Duration) Option Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Mutex ¶ type Mutex struct { redis.Cmdable // contains filtered or unexported fields } func New ¶ func New(redis redis.Cmdable, opts ...Option) *Mutex func (*Mutex) Lock ¶ func (m *Mutex) Lock(ctx context.Context, name string) error func (*Mutex) Unlock ¶ func (m *Mutex) Unlock(ctx context.Context, name string) error type Option ¶ type Option func(*Mutex) func WithExpired ¶ func WithExpired(expired time.Duration) Option Source Files ¶ View all Source files mutex.go Click to show internal directories. Click to hide internal directories.