ratelimiter

package
v0.0.0-...-7a6a509 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRateLimiterMiddleware

func NewRateLimiterMiddleware(generalRateLimiter, unauthenticatedRateLimiter RateLimiter) echo.MiddlewareFunc

Types

type RateLimiter

type RateLimiter interface {
	Check(identifier string) (bool, map[string]string, error)
	Increment(identifier string)
}

func NewRateLimiter

func NewRateLimiter(globalLimit, perProcessLimit int, resetInterval ResetInterval) RateLimiter

type ResetInterval

type ResetInterval interface {
	Next(identifier string) time.Time
}

func NewUserHashResetInterval

func NewUserHashResetInterval(interval time.Duration, now func() time.Time) ResetInterval

Jump to

Keyboard shortcuts

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