Package dev.forst.ktor.ratelimiting

Types

Link copied to clipboard
class LinearRateLimiter(limitersSettings: Map<UUID, Pair<Long, Duration>>, purgeHitSize: Int, purgeHitDuration: Duration, nowProvider: () -> Instant, initialSize: Int)

Linear implementation of the rate limiting.

Link copied to clipboard
typealias RateLimitExclusion = suspend ApplicationCall.() -> Boolean
Link copied to clipboard
typealias RateLimitHitAction = suspend ApplicationCall.(key: String, retryAfter: Long) -> Unit
Link copied to clipboard
class RateLimitingConfiguration

Configuration for the Rate Limiting plugin.

Link copied to clipboard
typealias RateLimitKeyExtraction = suspend ApplicationCall.() -> String?

Properties

Link copied to clipboard
val RateLimiting: ApplicationPlugin<RateLimitingConfiguration>

Simple rate limiting implementation using LinearRateLimiter in the application.

Link copied to clipboard
val RouteRateLimiting: RouteScopedPlugin<RateLimitingConfiguration>

Simple rate limiting implementation using LinearRateLimiter in a single route.