Versions in this module Expand all Collapse all v1 v1.1.0 Apr 30, 2026 Changes in this version + type Distributed struct + func NewDistributed(opts ...Option) *Distributed + func (d *Distributed) Mutex(ctx context.Context, option LockOption, fn func(ctx context.Context) error) error + type LockOption struct + Name string + TTL time.Duration + type Locker interface + TryLock func(ctx context.Context, option LockOption) (acquired bool, err error) + type Option func(*Distributed) + func WithLocker(locker Locker) Option + func WithLogger(logger *zap.SugaredLogger) Option + type RedisLocker struct + func NewRedisLocker(client *redis.Client) *RedisLocker + func (l *RedisLocker) TryLock(ctx context.Context, option LockOption) (bool, error)