Documentation
¶
Overview ¶
Package http decorates an http.Handler and prevents too many requests being made
Index ¶
Constants ¶
View Source
const StatusTooManyRequests = 429
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RateLimitedHandler ¶
type RateLimitedHandler struct {
// contains filtered or unexported fields
}
func Decorate ¶
func Decorate(delegate http.Handler, rateLimiter RateLimiter) RateLimitedHandler
func (RateLimitedHandler) ServeHTTP ¶
func (lh RateLimitedHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)