Documentation ¶
Overview ¶
Package ratelimit implements a rate limiting middleware
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultRateLimiter ¶
func DefaultRateLimiter() echo.MiddlewareFunc
DefaultRateLimiter returns a middleware function for rate limiting requests, see https://echo.labstack.com/docs/middleware/rate-limiter
func RateLimiterWithConfig ¶
func RateLimiterWithConfig(conf *Config) echo.MiddlewareFunc
RateLimiterWithConfig returns a middleware function for rate limiting requests with a config supplied, see https://echo.labstack.com/docs/middleware/rate-limiter
Types ¶
type Config ¶
type Config struct { RateLimit float64 `split_words:"true" default:"10"` // DATUM_RATE_LIMIT BurstLimit int `split_words:"true" default:"30"` // DATUM_BURST_LIMIT ExpiresIn time.Duration `split_words:"true" default:"1m"` // DATUM_EXPIRES_IN }
Config defines the configuration settings for the default rate limiter
Click to show internal directories.
Click to hide internal directories.