Documentation
¶
Index ¶
- func BasicAuth(credential string) func(http.Handler) http.Handler
- func RateLimitByIP(rps float64, burst int, idleTTL time.Duration, exemptPathPrefixes ...string) func(http.Handler) http.Handler
- func RateLimitByIPWithConfig(rps float64, burst int, cfg RateLimitByIPConfig) func(http.Handler) http.Handler
- func Timeout(timeout time.Duration, exemptPathPrefixes ...string) func(http.Handler) http.Handler
- type RateLimitByIPConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RateLimitByIP ¶
func RateLimitByIP(rps float64, burst int, idleTTL time.Duration, exemptPathPrefixes ...string) func(http.Handler) http.Handler
RateLimitByIP applies token-bucket rate limiting keyed by client IP.
func RateLimitByIPWithConfig ¶
func RateLimitByIPWithConfig(rps float64, burst int, cfg RateLimitByIPConfig) func(http.Handler) http.Handler
RateLimitByIPWithConfig applies token-bucket rate limiting keyed by client IP with bounded stale cleanup and optional client cardinality cap.
Types ¶
Click to show internal directories.
Click to hide internal directories.