middlewares

package
v0.0.0-...-36fb5e2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRateLimit = RateLimitOpts{
	Rate:      100,
	Burst:     10,
	ExpiresIn: 1 * time.Minute,
}

Functions

func NewApiKey

func NewApiKey(apiKey string) echo.MiddlewareFunc

NewApiKey configures the options to implements an api key.

func NewAuth0ValidatorMiddleware

func NewAuth0ValidatorMiddleware(validator jwt.Auth0Validator) echo.MiddlewareFunc

func NewCustomLogger

func NewCustomLogger() middleware.LoggerConfig

func NewRateLimit

func NewRateLimit(opts RateLimitOpts) middleware.RateLimiterConfig

NewRateLimit configures the options to limit the request based on env variables or the default values will be configured.

func NewRequestIdMiddleware

func NewRequestIdMiddleware() echo.MiddlewareFunc

Types

type RateLimitOpts

type RateLimitOpts struct {
	Rate      int
	Burst     int
	ExpiresIn time.Duration
}

Jump to

Keyboard shortcuts

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