Documentation
¶
Overview ¶
Package memory provides a deterministic process-local lease store.
Index ¶
- type Store
- func (store *Store) Acquire(ctx context.Context, key string, owner string, ttl time.Duration, ...) (lease.Lease, error)
- func (*Store) Capabilities() lease.Capabilities
- func (store *Store) Heartbeat(ctx context.Context, owned lease.Lease, ttl time.Duration, now time.Time) (lease.Lease, error)
- func (store *Store) Inspect(ctx context.Context, key string) (lease.Lease, error)
- func (store *Store) Recover(ctx context.Context, key string, fencingToken uint64) error
- func (store *Store) Release(ctx context.Context, owned lease.Lease) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store keeps fenced leases in memory for tests and single-process tools.
func (*Store) Acquire ¶
func (store *Store) Acquire( ctx context.Context, key string, owner string, ttl time.Duration, now time.Time, ) (lease.Lease, error)
Acquire creates or takes over an expired lease.
func (*Store) Capabilities ¶
func (*Store) Capabilities() lease.Capabilities
Capabilities reports the memory store's safety properties.
func (*Store) Heartbeat ¶
func (store *Store) Heartbeat( ctx context.Context, owned lease.Lease, ttl time.Duration, now time.Time, ) (lease.Lease, error)
Heartbeat extends a lease held by its current owner.
Click to show internal directories.
Click to hide internal directories.