ratelimit

package module
v0.0.0-...-bae051a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2024 License: BSD-2-Clause Imports: 8 Imported by: 0

README

echo-rate-limiter-fail2ban

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL