Versions in this module Expand all Collapse all v1 v1.4.0 Jan 14, 2016 v1.3.0 Dec 14, 2015 Changes in this version + var DefaultDeniedHandler = http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ... })) + var ErrNoSuchKey = errors.New("throttled: no such key") + var Error = ErrorFunc(func(w http.ResponseWriter, r *http.Request, err error) { ... }) + func MemThresholds(offset *runtime.MemStats) *runtime.MemStats + func RemainingSeconds(ts time.Time, window time.Duration) int + type D time.Duration + func (d D) Delay() time.Duration + type Delayer interface + Delay func() time.Duration + type ErrorFunc func(w http.ResponseWriter, r *http.Request, err error) + type Limiter interface + Limit func(http.ResponseWriter, *http.Request) (<-chan bool, error) + Start func() + type PerDay int + func (pd PerDay) Delay() time.Duration + func (pd PerDay) Quota() (int, time.Duration) + type PerHour int + func (ph PerHour) Delay() time.Duration + func (ph PerHour) Quota() (int, time.Duration) + type PerMin int + func (pm PerMin) Delay() time.Duration + func (pm PerMin) Quota() (int, time.Duration) + type PerSec int + func (ps PerSec) Delay() time.Duration + func (ps PerSec) Quota() (int, time.Duration) + type Q struct + Requests int + Window time.Duration + func (q Q) Quota() (int, time.Duration) + type Quota interface + Quota func() (int, time.Duration) + type Store interface + Incr func(string, time.Duration) (int, int, error) + Reset func(string, time.Duration) error + type Throttler struct + DeniedHandler http.Handler + func Custom(l Limiter) *Throttler + func Interval(delay Delayer, bursts int, vary *VaryBy, maxKeys int) *Throttler + func MemStats(thresholds *runtime.MemStats, refreshRate time.Duration) *Throttler + func RateLimit(q Quota, vary *VaryBy, store Store) *Throttler + func (t *Throttler) Throttle(h http.Handler) http.Handler + type VaryBy struct + Cookies []string + Custom func(r *http.Request) string + Headers []string + Method bool + Params []string + Path bool + RemoteAddr bool + Separator string + func (vb *VaryBy) Key(r *http.Request) string Incompatible versions in this module v2.0.0+incompatible Feb 13, 2016