Documentation
¶
Overview ¶
Package automaticstore persists automatic-admission accounting in one flock-serialized, crash-safe document shared by cooperating processes.
Index ¶
- type Store
- func (s *Store) DiscoverExpired(ctx context.Context, limit uint32) ([]learning.AutomaticReservation, error)
- func (s *Store) Get(ctx context.Context, id learning.AutomaticReservationID) (learning.AutomaticReservation, bool, error)
- func (s *Store) Reassign(ctx context.Context, id learning.AutomaticReservationID, ...) (learning.AutomaticReservation, error)
- func (s *Store) Reclaim(ctx context.Context, id learning.AutomaticReservationID, ...) (learning.AutomaticReservation, error)
- func (s *Store) Reserve(ctx context.Context, req learning.AutomaticReservationRequest) (learning.AutomaticReservation, error)
- func (s *Store) Retain(ctx context.Context, id learning.AutomaticReservationID, ...) (learning.AutomaticReservation, 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 is a durable learning.AutomaticAdmissionLedger for cooperating processes on one host filesystem. Each operation reloads under flock; no process-local cache participates in admission decisions.
func New ¶
New prepares a ledger rooted at dir with backend-owned immutable policy and time authority.
func (*Store) DiscoverExpired ¶
func (s *Store) DiscoverExpired(ctx context.Context, limit uint32) ([]learning.AutomaticReservation, error)
DiscoverExpired atomically claims a bounded set of expired held records using this store's authoritative clock.
func (*Store) Get ¶
func (s *Store) Get(ctx context.Context, id learning.AutomaticReservationID) (learning.AutomaticReservation, bool, error)
func (*Store) Reassign ¶
func (s *Store) Reassign(ctx context.Context, id learning.AutomaticReservationID, expected learning.AutomaticReservationVersion) (learning.AutomaticReservation, error)
func (*Store) Reclaim ¶
func (s *Store) Reclaim(ctx context.Context, id learning.AutomaticReservationID, expected learning.AutomaticReservationVersion, fence learning.AutomaticReservationFence) (learning.AutomaticReservation, error)
func (*Store) Reserve ¶
func (s *Store) Reserve(ctx context.Context, req learning.AutomaticReservationRequest) (learning.AutomaticReservation, error)
Reserve atomically applies all configured accounting controls.
func (*Store) Retain ¶
func (s *Store) Retain(ctx context.Context, id learning.AutomaticReservationID, expected learning.AutomaticReservationVersion, fence learning.AutomaticReservationFence) (learning.AutomaticReservation, error)
Click to show internal directories.
Click to hide internal directories.