Documentation ¶
Overview ¶
Package ratelimit implements a rate limiting middleware
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RateLimiterWithConfig ¶
func RateLimiterWithConfig(conf *Config) echo.MiddlewareFunc
RateLimiterWithConfig returns a middleware function for rate limiting requests with a config supplied
Types ¶
type Config ¶
type Config struct { Enabled bool `json:"enabled" koanf:"enabled" default:"false"` RateLimit float64 `json:"limit" koanf:"limit" default:"10"` BurstLimit int `json:"burst" koanf:"burst" default:"30"` ExpiresIn time.Duration `json:"expires" koanf:"expires" default:"10m"` }
Config defines the configuration settings for the default rate limiter
Click to show internal directories.
Click to hide internal directories.