RateLimitConfig Type

Configuration for rate limiting

Record fields

Record Field Description

keyExtractor

Full Usage: keyExtractor

Field type: HttpContext -> string

Function to extract key from context (e.g., IP address, user ID)

Field type: HttpContext -> string

limitExceededMessage

Full Usage: limitExceededMessage

Field type: string option

Message to return when rate limit is exceeded

Field type: string option

maxRequests

Full Usage: maxRequests

Field type: int

Maximum number of requests allowed in the window

Field type: int

retryAfter

Full Usage: retryAfter

Field type: int option

Retry-After header value in seconds when limit exceeded

Field type: int option

strategy

Full Usage: strategy

Field type: RateLimitStrategy

Rate limiting strategy to use

Field type: RateLimitStrategy

windowSize

Full Usage: windowSize

Field type: TimeSpan

Time window for rate limiting

Field type: TimeSpan