locking

package
v0.2.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(key string)

func Lock

func Lock(key, identifier string)

func LockWithContext

func LockWithContext(ctx context.Context, key, identifier string) error

func LockedBy

func LockedBy(key string) (string, bool)

func RegisterLocker

func RegisterLocker(lock Locker) error

func TryLock

func TryLock(key, identifier string) (ok bool)

func Unlock

func Unlock(key string, remove bool)

Types

type InstanceDeleteBackoff

type InstanceDeleteBackoff interface {
	ShouldProcess(key string) (bool, time.Time)
	Delete(key string)
	RecordFailure(key string)
}

func NewInstanceDeleteBackoff

func NewInstanceDeleteBackoff(_ context.Context) (InstanceDeleteBackoff, error)

type Locker

type Locker interface {
	TryLock(key, identifier string) bool
	Lock(key, identifier string)
	LockWithContext(ctx context.Context, key, identifier string) error
	LockedBy(key string) (string, bool)
	Unlock(key string, remove bool)
	Delete(key string)
}

func NewLocalLocker

func NewLocalLocker(_ context.Context, _ dbCommon.Store) (Locker, error)

Jump to

Keyboard shortcuts

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