filelock

package
v0.57.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinator

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

Coordinator combines an inner coordinator for ObjectStore scopes with one advisory lock file per keyed scope for cross-process keyed exclusion.

func NewCoordinator

func NewCoordinator(dir, storeID string, inner coord.Coordinator) *Coordinator

NewCoordinator builds a file lock coordinator over dir. Scopes without a Key delegate to inner. storeID must identify the complete backing store so sibling volumes sharing dir do not contend. On platforms without advisory file locks the keyed scopes fall back to in-memory exclusion.

func (*Coordinator) Capability

func (c *Coordinator) Capability(ctx context.Context, scope coord.Scope) (*coord.Capability, error)

Capability reports keyed file lock support, delegating ObjectStore scopes.

func (*Coordinator) Snapshot

func (c *Coordinator) Snapshot(ctx context.Context, scope coord.Scope) (*coord.Snapshot, error)

Snapshot delegates ObjectStore scopes; keyed scopes carry no generations.

func (*Coordinator) TryAcquireWriteLease

func (c *Coordinator) TryAcquireWriteLease(ctx context.Context, scope coord.Scope) (coord.WriteLease, bool, error)

TryAcquireWriteLease attempts to acquire the keyed file lock without blocking.

func (*Coordinator) WaitAcquireWriteLease

func (c *Coordinator) WaitAcquireWriteLease(ctx context.Context, scope coord.Scope) (coord.WriteLease, error)

WaitAcquireWriteLease waits until the keyed file lock is available.

func (*Coordinator) Watch

func (c *Coordinator) Watch(ctx context.Context, scope coord.Scope, afterGeneration uint64) (coord.Watch, error)

Watch delegates ObjectStore scopes; keyed scopes carry no event stream.

Jump to

Keyboard shortcuts

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