Documentation
¶
Overview ¶
Package ratelimit provides middleware for rate limiting HTTP requests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidLimiter = errors.New("invalid limiter")
ErrInvalidLimiter is returned when the given limiter is invalid.
View Source
var ErrNilOption = errors.New("option cannot be nil")
ErrNilOption is returned when an option is nil.
Functions ¶
func New ¶
func New(options ...func(*Handler) error) (defs.Middleware, error)
New creates a new rate limiter middleware.
func WithLimiter ¶
WithLimiter sets the Limiter to use.
func WithLogLevel ¶
WithLogLevel configures the log level to use with the logger.
Types ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package locallimit provides a process-local rate limiter.
|
Package locallimit provides a process-local rate limiter. |
Click to show internal directories.
Click to hide internal directories.