goodies: github.com/99designs/goodies/http/ratelimiter Index | Files

package ratelimiter

import "github.com/99designs/goodies/http/ratelimiter"

Package http decorates an http.Handler and prevents too many requests being made

Index

Package Files

ratelimiter.go

Constants

const StatusTooManyRequests = 429

type RateLimitedHandler Uses

type RateLimitedHandler struct {
    // contains filtered or unexported fields
}

func Decorate Uses

func Decorate(delegate http.Handler, rateLimiter RateLimiter) RateLimitedHandler

func (RateLimitedHandler) ServeHTTP Uses

func (lh RateLimitedHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type RateLimiter Uses

type RateLimiter func(*http.Request) (ok bool, retryAfter time.Duration)

Package ratelimiter imports 3 packages (graph). Updated 2016-10-19. Refresh now. Tools for package owners.