Documentation
¶
Overview ¶
Package valkey provides native atomic fenced leases for Valkey.
Index ¶
- type Guard
- type Store
- func (store *Store) Guard(owned lease.Record) (Guard, error)
- func (store *Store) Release(ctx context.Context, owned lease.Record) error
- func (store *Store) Renew(ctx context.Context, owned lease.Record, ttl time.Duration) (lease.Record, error)
- func (store *Store) TryAcquire(ctx context.Context, key lease.Key, owner string, ttl time.Duration) (lease.Record, error)
- func (store *Store) Validate(ctx context.Context, owned lease.Record) (lease.Record, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Guard ¶
type Guard struct {
// contains filtered or unexported fields
}
Guard is an opaque active-ownership proof for atomic Valkey protected writes.
func (Guard) StorageKey ¶
StorageKey returns the redacted Valkey lease hash key.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store persists atomic leases using backend-time Lua operations.
func New ¶
New constructs a native Valkey backend. The client owns reconnect, ACL, TLS, routing, and timeout policy and must be closed by its creator.
func (*Store) Guard ¶
Guard derives the backend coordinates required to validate owned atomically. The protected writer must use the same Valkey deployment as this Store.
func (*Store) Renew ¶
func (store *Store) Renew( ctx context.Context, owned lease.Record, ttl time.Duration, ) (lease.Record, error)
Renew atomically compares owner and token before extending backend expiry.
Click to show internal directories.
Click to hide internal directories.