github.com/go-chi/httprate

httprate

net/http rate limiter middleware

81

Decision Signals

Health score 81/100, confidence 95/100.

Strong
Maintenance 61
Adoption 97
Security 92
Maturity 87
Developer DX 69
Confidence 95

Install

go get github.com/go-chi/httprate

Package Data

updated Jun 11, 2026
Latest versionv0.15.0
Imported by256 packages
Stars462
Forks22
Last activity8 months ago
Latest releasev0.15.0 (1 years ago)
LicenseMIT
Known vuln records0

API Surface

40 symbols
SymbolKindSynopsis
KeyFunc Type type KeyFunc func(r *http.Request) (string, error)
LimitCounter Type type LimitCounter interface{ ... }
LimitCounter.Config Method Config func(requestLimit int, windowLength time.Duration)
LimitCounter.Get Method Get func(key string, currentWindow, previousWindow time.Time) (int, int, error)
LimitCounter.Increment Method Increment func(key string, currentWindow time.Time) error
LimitCounter.IncrementBy Method IncrementBy func(key string, currentWindow time.Time, amount int) error
Option Type type Option func(rl *RateLimiter)
WithErrorHandler Function func WithErrorHandler(h func(http.ResponseWriter, *http.Request, error)) Option
WithKeyByIP Function func WithKeyByIP() Option
WithKeyByRealIP Function func WithKeyByRealIP() Option
WithKeyFuncs Function func WithKeyFuncs(keyFuncs ...KeyFunc) Option
WithLimitCounter Function func WithLimitCounter(c LimitCounter) Option

Similar Packages

Go Rate Limiting Libraries

#1 go-limiter

Package limiter defines rate limiting systems.

Go Rate Limiting Libraries 0 stars 66 imported-by 75% confidence
63

#2 Limiter

Dead simple rate limit middleware for Go.

Go Rate Limiting Libraries 0 stars 449 imported-by 80% confidence
52

#3 ratelimit

Go Rate Limiting Libraries 0 stars 0 imported-by 40% confidence
41