Documentation
¶
Index ¶
- type Coordinator
- func (c *Coordinator) Capability(ctx context.Context, scope coord.Scope) (*coord.Capability, error)
- func (c *Coordinator) Snapshot(ctx context.Context, scope coord.Scope) (*coord.Snapshot, error)
- func (c *Coordinator) TryAcquireWriteLease(ctx context.Context, scope coord.Scope) (coord.WriteLease, bool, error)
- func (c *Coordinator) WaitAcquireWriteLease(ctx context.Context, scope coord.Scope) (coord.WriteLease, error)
- func (c *Coordinator) Watch(ctx context.Context, scope coord.Scope, afterGeneration uint64) (coord.Watch, error)
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 ¶
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.