Documentation
¶
Overview ¶
Package valkey provides atomic fenced leases backed by Valkey 9 or newer.
Index ¶
- Constants
- type Store
- func (store *Store) Acquire(ctx context.Context, key string, owner string, ttl time.Duration, _ time.Time) (lease.Lease, error)
- func (*Store) Capabilities() lease.Capabilities
- func (store *Store) Check(ctx context.Context) error
- func (store *Store) Heartbeat(ctx context.Context, owned lease.Lease, ttl time.Duration, _ 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 ¶
View Source
const MaxPrefixBytes = 64
MaxPrefixBytes bounds the configured Valkey key prefix.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store persists atomic TTL leases and monotonic fencing counters in Valkey.
func (*Store) Acquire ¶
func (store *Store) Acquire( ctx context.Context, key string, owner string, ttl time.Duration, _ time.Time, ) (lease.Lease, error)
Acquire creates or takes over an expired lease atomically.
func (*Store) Capabilities ¶
func (*Store) Capabilities() lease.Capabilities
Capabilities reports the Valkey store's safety properties.
func (*Store) Heartbeat ¶
func (store *Store) Heartbeat( ctx context.Context, owned lease.Lease, ttl time.Duration, _ time.Time, ) (lease.Lease, error)
Heartbeat extends a lease held by the current fenced owner.
Click to show internal directories.
Click to hide internal directories.