Skip to content

common_rates.limiters.registry

The backend axis: a config’s backend to the limiter class that keeps its state.

Functions

resolve

def resolve(backend: str) -> type[BaseLimiter]

The limiter class for a backend name.

Types and values

BACKENDS

BACKENDS: Mapping[str, str] = MappingProxyType({'memory': 'common_rates.limiters.memory:MemoryLimiter', 'postgres': 'common_rates.limiters.postgres:PostgresLimiter'})

DECLARED_ONLY

DECLARED_ONLY: frozenset[str] = frozenset({'redis'})