Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAlreadyConnected = errors.New("DISTRIBUTED_LOCK_MANAGER.ALREADY_CONNECTED.ERROR") ErrNotConnected = errors.New("DISTRIBUTED_LOCK_MANAGER.NOT_CONNECTED.ERROR") ErrKeyEmpty = errors.New("DISTRIBUTED_LOCK_MANAGER.KEY.EMPTY.ERROR") ErrLock = errors.New("DISTRIBUTED_LOCK_MANAGER.LOCK.ERROR") ErrUnlock = errors.New("DISTRIBUTED_LOCK_MANAGER.UNLOCK.ERROR") )
Functions ¶
Types ¶
type DistributedLockManager ¶
type DistributedLockManager interface {
patterns.Connectable
Lock(ctx context.Context, key string, opts ...config.Option) (Identifier, error)
}
func NewRedlock ¶
func NewRedlock(conf *config.Config) (DistributedLockManager, error)
NewRedlock creates a new distributed lock manager instance that uses redis as the underlying storage and redlock as the algorithm.
type Identifier ¶
Click to show internal directories.
Click to hide internal directories.