Documentation ¶
Overview ¶
Package rate provides a set of rate-limit proxy and router middlewares using the golang.org/x/time/rate lib.
The rate package provides an efficient token bucket implementation. See https://golang.org/x/time/rate and http://en.wikipedia.org/wiki/Token_bucket for more details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLimiterStore ¶
func NewLimiterStore(maxRate float64, capacity int, backend krakendrate.Backend) krakendrate.LimiterStore
NewLimiterStore returns a LimiterStore using the received backend for persistence
func NewMemoryStore ¶
func NewMemoryStore(maxRate float64, capacity int) krakendrate.LimiterStore
NewMemoryStore returns a LimiterStore using the memory backend
Types ¶
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
Limiter is a simple wrapper over the rate.Limiter struct
func NewLimiter ¶
NewLimiter creates a new Limiter
Directories ¶
Path | Synopsis |
---|---|
Package proxy provides a rate-limit proxy middleware using the golang.org/x/time/rate lib.
|
Package proxy provides a rate-limit proxy middleware using the golang.org/x/time/rate lib. |
Package router provides several rate-limit routers using the golang.org/x/time/rate lib.
|
Package router provides several rate-limit routers using the golang.org/x/time/rate lib. |
Click to show internal directories.
Click to hide internal directories.