Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware(cfg *Config) echo.MiddlewareFunc
Types ¶
type Config ¶
type Config struct { // determines the window of time for which bans will be calculated before the deny counter is reset RefreshDuration time.Duration RedisConn redis.Conn // if the user is denied more than this number of times, they'll be banned for the specified period DenyThreshold int BanDuration time.Duration }
Click to show internal directories.
Click to hide internal directories.