Versions in this module Expand all Collapse all v0 v0.1.0 Oct 18, 2026 Changes in this version + var ErrInvalidRequest = errors.New("coordination: invalid request") + var ErrLeaseLost = errors.New("coordination: lease lost") + var ErrNotAcquired = errors.New("coordination: not acquired") + var ErrNotOwner = errors.New("coordination: not owner") + func KeepAlive(ctx context.Context, lease Lease, ttl time.Duration) (*concurrency.Future[LeaseInfo], error) + type AcquireRequest struct + Key string + Owner string + TTL time.Duration + Wait bool + type Backend interface + Acquire func(ctx context.Context, request AcquireRequest) (Lease, error) + type Barrier interface + Wait func(ctx context.Context, request BarrierRequest) (BarrierResult, error) + type BarrierRequest struct + Name string + Participant string + Parties int + TTL time.Duration + type BarrierResult struct + Generation uint64 + Name string + Participants []string + type Clock interface + After func(d time.Duration) <-chan time.Time + Now func() time.Time + type ElectionOptions struct + Candidate string + Name string + TTL time.Duration + type FencingToken uint64 + type Leadership struct + Lost <-chan struct{} + Token FencingToken + func Campaign(ctx context.Context, backend Backend, options ElectionOptions) (Leadership, error) + func (l Leadership) Resign(ctx context.Context) error + type Lease interface + Done func() <-chan struct{} + Info func() LeaseInfo + Release func(ctx context.Context) error + Renew func(ctx context.Context, ttl time.Duration) (LeaseInfo, error) + type LeaseInfo struct + AcquiredAt time.Time + ExpiresAt time.Time + Key string + Owner string + Token FencingToken + type Member struct + Group string + ID string + Metadata map[string]string + type MemberInfo struct + ExpiresAt time.Time + JoinedAt time.Time + Member Member + type Membership interface + Done func() <-chan struct{} + Info func() MemberInfo + Leave func(ctx context.Context) error + Renew func(ctx context.Context, ttl time.Duration) (MemberInfo, error) + type Mutex struct + func NewMutex(backend Backend, key, owner string, ttl time.Duration) (*Mutex, error) + func (m *Mutex) Lock(ctx context.Context) (FencingToken, error) + func (m *Mutex) Unlock(ctx context.Context) error + type Registry interface + Join func(ctx context.Context, member Member, ttl time.Duration) (Membership, error) + List func(ctx context.Context, group string) ([]MemberInfo, error)