etcd

package
v1.10.6 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lock

type Lock struct {
	// contains filtered or unexported fields
}

func (*Lock) Acquire

func (l *Lock) Acquire(ctx context.Context) (<-chan struct{}, error)

Acquire implements lock.DistributedLock.

func (*Lock) IsLocked

func (l *Lock) IsLocked() bool

IsLocked implements lock.DistributedLock

func (*Lock) Unlock

func (l *Lock) Unlock(ctx context.Context) error

Unlock implements lock.DistributedLock

type LockManager

type LockManager struct {
	// contains filtered or unexported fields
}

func NewLockManager

func NewLockManager(
	client *v3.Client,
	rootKey string,
	lockTTL time.Duration,
	lockValue string,
) (*LockManager, error)

func (*LockManager) Close

func (lm *LockManager) Close()

Close will close the lock manager, _and all locked locks created by the lock manager will become unlocked_.

func (*LockManager) Create

func (lm *LockManager) Create(_ context.Context, name string) (lock.DistributedLock, error)

Create implements lock.DistributedLock.

Jump to

Keyboard shortcuts

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