ratelimiter

package
v0.0.0-...-a930f92 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2016 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLimitReached = errors.New("Limit reached")
)

Functions

This section is empty.

Types

type RateLimiter

type RateLimiter interface {
	AddBucket(duration time.Duration, limit int) RateLimiter
	SetBuckets(buckets map[time.Duration]int) RateLimiter
	DelBucket(duration time.Duration) RateLimiter
	Validate(key string) error
}

RateLimiter represents a rate limiter

func NewRateLimiter

func NewRateLimiter(h cachemanager.Handler) RateLimiter

NewRateLimiter creates a new rate limiter

Jump to

Keyboard shortcuts

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