middleware

package
v0.0.0-...-c9ce307 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(username, password string) func(echo.HandlerFunc) echo.HandlerFunc

func CORS

func CORS(allowedOrigins string) echo.MiddlewareFunc

func Monitoring

func Monitoring() echo.MiddlewareFunc

func NewErrorHandler

func NewErrorHandler() func(err error, c echo.Context)

func RateLimiting

func RateLimiting(rpm uint16, options ...RateLimitingOption) echo.MiddlewareFunc

func RequestLogger

func RequestLogger() func(echo.HandlerFunc) echo.HandlerFunc

Types

type RateLimitingOption

type RateLimitingOption func(cfg *echomw.RateLimiterConfig)

func WithIP

func WithIP() RateLimitingOption

WithIP extracts the id from the real ip. This functional option is passed to RateLimiting.

func WithUserID

func WithUserID() RateLimitingOption

WithUserID extracts the id from the userId header. This functional option is passed to RateLimiting.

func WithUserIP

func WithUserIP() RateLimitingOption

WithUserIP extracts the id from the userId header + real ip. This functional option is passed to RateLimiting.

Jump to

Keyboard shortcuts

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