coordination

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidLease = errors.New("coordination: invalid lease")

Functions

This section is empty.

Types

type Lease

type Lease struct {
	Key       string
	Owner     string
	ExpiresAt time.Time
}

func (Lease) Validate

func (lease Lease) Validate() error

type Locker

type Locker interface {
	Acquire(ctx context.Context, key string, owner string, ttl time.Duration) (Lease, bool, error)
	Renew(ctx context.Context, lease Lease, ttl time.Duration) (Lease, bool, error)
	Release(ctx context.Context, lease Lease) error
}

Jump to

Keyboard shortcuts

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