common_rates.schemas.results
What a limiter reports: one admission, one quota’s standing, and the limiter itself.
Light, built by code we own, never carrying a secret or a payload.
Classes
Balance
One quota’s standing for a scope, as the backend last knew it.
replenishes_at is when a unit is next available: the window’s reset for a
window quota, the next refill for an exhausted bucket, None when units remain.
__init__
def __init__(scope: Scope, quota: str, remaining: float, replenishes_at: datetime | None) -> NoneFields and properties declared here; inherited members belong to the bases above.
quota
quota: strremaining
remaining: floatreplenishes_at
replenishes_at: datetime | Nonescope
scope: ScopeLimiterInfo
What a limiter is and where it stands; the info seam’s answer.
__init__
def __init__(backend: str, state: Literal['new', 'open', 'closed'], scopes: tuple[str, ...]) -> NoneFields and properties declared here; inherited members belong to the bases above.
backend
backend: strscopes
scopes: tuple[str, ...]state
state: Literal['new', 'open', 'closed']Permit
One admission granted: what it cost, how long it waited, and which quota gated it.
__init__
def __init__(scope: Scope, cost: float, waited: float, gated_by: str | None, granted_at: datetime) -> NoneFields and properties declared here; inherited members belong to the bases above.
cost
cost: floatgated_by
gated_by: str | Nonegranted_at
granted_at: datetimescope
scope: Scopewaited
waited: float