Documentation
¶
Overview ¶
Package memory implements explicit single-process leases. It never evicts live owners to make space and is never an automatic fallback for Redis failures.
Index ¶
- type Backend
- func (b *Backend) Close() error
- func (*Backend) FoundryAdapter(frameworkadapter.Seal)
- func (b *Backend) LeaseAcquire(ctx context.Context, key lease.Key, owner lease.Owner, ttl time.Duration) (bool, error)
- func (b *Backend) LeaseForceRelease(ctx context.Context, key lease.Key) (bool, error)
- func (b *Backend) LeaseRelease(ctx context.Context, key lease.Key, owner lease.Owner) (bool, error)
- func (b *Backend) LeaseRenew(ctx context.Context, key lease.Key, owner lease.Owner, ttl time.Duration) (bool, error)
- func (b *Backend) LeaseTransfer(ctx context.Context, key lease.Key, from, to lease.Owner, ttl time.Duration) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend owns a bounded set of leases using Go's monotonic clock. No background goroutine is needed: an operation checks only its own key, and a new key reclaims expired owners in deadline order before checking capacity.
func (*Backend) Close ¶
Close invalidates this explicit local authority. Close managers first so their callbacks and cleanup finish while the backend is still available.
func (*Backend) FoundryAdapter ¶
func (*Backend) FoundryAdapter(frameworkadapter.Seal)
FoundryAdapter marks the backend as framework-owned adapter I/O.
func (*Backend) LeaseAcquire ¶
func (b *Backend) LeaseAcquire(ctx context.Context, key lease.Key, owner lease.Owner, ttl time.Duration) (bool, error)
LeaseAcquire acquires an absent or expired key; capacity exhaustion returns fault.Conflict.
func (*Backend) LeaseForceRelease ¶
LeaseForceRelease administratively removes key regardless of its owner.
func (*Backend) LeaseRelease ¶
LeaseRelease removes key only if owner matches its unexpired owner.