locking

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: Apache-2.0 Imports: 8 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 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)
	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