Versions in this module Expand all Collapse all v0 v0.3.0 Aug 5, 2026 Changes in this version type Holder + LeaseID string type Store + func (s *Store) Close() error + func (s *Store) History() (*history.Log, error) v0.2.0 Aug 4, 2026 Changes in this version + const DefaultWaiterPIDGrace type AcquireOpts + Reclaim bool + WaiterID string type KeyStatus + Error string type PruneResult + Errors []string type Store + WaiterPIDGrace time.Duration type Waiter + ID string v0.1.0 Jul 27, 2026 Changes in this version + const DefaultPollInterval + const DefaultTTL + const DefaultWaiterStaleAfter + const MaxKeyLen + var ErrNotHeld = errors.New("no lease held for this key") + func DecodeKey(name string) (string, error) + func EncodeKey(key string) string + func NewToken() string + func ValidateKey(key string) error + type AcquireOpts struct + Agent string + Enqueued bool + Host string + PID int + Reason string + TTL time.Duration + type AcquireResult struct + Acquired bool + Blocker *Waiter + Holder *Holder + type CorruptError struct + Err error + Path string + func (e *CorruptError) Error() string + type Holder struct + AcquiredAt time.Time + Agent string + ExpiresAt time.Time + Host string + Key string + PID int + Reason string + RenewedAt *time.Time + Token string + func (h *Holder) ExpiredAt(now time.Time) bool + type KeyStatus struct + Holder *Holder + Key string + State string + Waiters []Waiter + type NotHolderError struct + Holder *Holder + func (e *NotHolderError) Error() string + type PruneResult struct + ExpiredLeases []string + StaleWaiters int + type Store struct + Root string + WaiterStaleAfter time.Duration + func Open(root string) (*Store, error) + func (s *Store) Dequeue(entryPath string) error + func (s *Store) Enqueue(key string, w Waiter) (string, error) + func (s *Store) Heartbeat(entryPath string, w Waiter) error + func (s *Store) List() ([]KeyStatus, error) + func (s *Store) Prune() (*PruneResult, error) + func (s *Store) Release(key, token string, force bool) (*Holder, error) + func (s *Store) Renew(key, token string, ttl time.Duration) (*Holder, error) + func (s *Store) Status(key string) (*KeyStatus, error) + func (s *Store) TryAcquire(key, token string, o AcquireOpts) (*AcquireResult, error) + type Waiter struct + Agent string + EnqueuedAt time.Time + Fresh bool + Host string + LastSeen time.Time + PID int + Reason string + Token string