INNER CODE UNIT · Python
Limiter
laurentS/slowapi · slowapi/extension.py:90
class Limiter:
"""
Initializes the slowapi rate limiter.
** parameter **
* **app**: `Starlette/FastAPI` instance to initialize the extension
with.
* **default_limits**: a variable list of strings or callables returning strings denoting global
limits to apply to all routes. `ratelimit-string` for more details.
* **application_limits**: a variable list of strings or callables returning strings for limits that
are applied to the entire application (i.e a shared limit for all routes)
* **key_func**: a callable that returns the domain to rate limit by.
* **headers_enabled**: whether ``X-RateLimit`` response headers are written.