http

package
v0.0.0-...-430806f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2013 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package http rate 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 {
	http.Handler
	// 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)

type RateLimiter

type RateLimiter func(*http.Request) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL