Package-level declarations

The package contains the feature RateLimit and the Storage implementation.

Types

Link copied to clipboard
class Configuration(val storage: Storage)

Configuration holder for the RateLimit feature.

Link copied to clipboard
interface RequestResult

The result if a call should be allowed or blocked.

Link copied to clipboard

Result of Configuration.skip to skip the rate limit for this host on SkipRateLimit or to execute it on ExecuteRateLimit

Link copied to clipboard
interface Storage

RateLimit uses a defined storage provider implementing this interface to persist the request information used for rate limiting. If you use a blocking database, you should wrap your calls inside withContext.

Functions

Link copied to clipboard
fun RateLimit(storage: Storage): RouteScopedPlugin<Configuration>

Rate limit feature to block a request if a host has requested the server too often.