Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
Middleware is a handler that exposes the token bucket used for rate limiting
func NewMiddleware ¶
func NewMiddleware(refillRatePerSecond int, maxRequestsCapacity int64, logger logrus.FieldLogger) (*Middleware, error)
NewMiddleware returns a new Rate limit handler.
func (Middleware) ServeHTTP ¶
func (mdl Middleware) ServeHTTP(w http.ResponseWriter, req *http.Request, next http.HandlerFunc)
Click to show internal directories.
Click to hide internal directories.