Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LimitHandler ¶
func LimitHandler(handler fasthttp.RequestHandler, limiter *ratelimit.RateLimiter, onLimitReachedHandler fasthttp.RequestHandler) fasthttp.RequestHandler
LimitHandler is a very simple FastHTTP adapter for `github.com/bsm/ratelimit`. It wraps original request handler with a rate-limited one
func SimpleLimitHandler ¶
func SimpleLimitHandler(handler fasthttp.RequestHandler, limiter *ratelimit.RateLimiter, statusCode int) fasthttp.RequestHandler
SimpleLimitHandler covers the most simple rate limiting case when the server only needs to return a predefined status code.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.