Documentation
¶
Overview ¶
Package exhausted owns the unified joint limit-key store (0.1.1).
A stored key is a filter over candidate dimensions: a candidate combination matching every stored dimension is skipped until ResetsAt passes. Expired entries delete on read; Prune sweeps entries nobody reads anymore.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildKey ¶
BuildKey assembles the canonical key: fixed dimension order, non-empty dimensions only. Prefixes keep dimensions unambiguous after the join.
func FullKey ¶
FullKey builds the strictest key: every known dimension. Used when a rate/quota error carries no scope: only the exact combination is skipped, so the router bypasses through everything else.
func KeyFromScope ¶
KeyFromScope builds the stored key for one error outcome: plugin and provider always participate, the scope words select the narrowing dimensions. Unknown scope words fail closed so typos never silently drop the marking.
Types ¶
type Segments ¶
Segments is the full identity of one request attempt. Plugin and Provider always participate (Provider is the configured instance ID, not the adapter type key); Account, Model and Proxy narrow the key when non-empty.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service persists ExhaustedEntry rows keyed by the canonical key.
func (*Service) Limited ¶
Limited reports whether the exact key limits now. Expired entries delete on read, so a passed limit never blocks again.
func (*Service) LimitedAny ¶
LimitedAny reports the first matching stored key for the full candidate, most-specific first. Empty when nothing limits the candidate.