distributedlockmanager

package
v0.0.0-...-8ffcee5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2024 License: MIT Imports: 11 Imported by: 1

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

func Key

func Key(k string) (string, error)

Types

type DistributedLockManager

type DistributedLockManager interface {
	patterns.Connectable
	Lock(ctx context.Context, key string, opts ...config.Option) (Identifier, error)
}

func New

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

type Identifier interface {
	Unlock(ctx context.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL