middleware

package
v0.0.0-...-f0b9b21 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLoggerMiddlewareFilterExclude = `((path.startsWith("/metrics") || path.startsWith("/healthz")) || status_code == 404)`
)

Variables

This section is empty.

Functions

func NewStaticBalancer

func NewStaticBalancer(host *url.URL) mw.ProxyBalancer

func OtelMiddleware

func OtelMiddleware() echo.MiddlewareFunc

OtelMiddleware returns echo middleware which will trace incoming requests.

func Recover

func Recover(next echo.HandlerFunc) echo.HandlerFunc

Recover prevents panics and outputs the panic message through our logger.

Types

type LoggerMiddleware

type LoggerMiddleware struct {
	// contains filtered or unexported fields
}

func NewLoggerMiddleware

func NewLoggerMiddleware(cfg LoggerMiddlewareConfig) (*LoggerMiddleware, error)

func (*LoggerMiddleware) L

func (*LoggerMiddleware) Middleware

func (h *LoggerMiddleware) Middleware() echo.MiddlewareFunc

type LoggerMiddlewareConfig

type LoggerMiddlewareConfig struct {
	FilterExclude string
}

type StaticBalancer

type StaticBalancer struct {
	// contains filtered or unexported fields
}

func (*StaticBalancer) AddTarget

func (b *StaticBalancer) AddTarget(*mw.ProxyTarget) bool

AddTarget doesn't do anything but return true

func (*StaticBalancer) Next

func (b *StaticBalancer) Next(c echo.Context) *mw.ProxyTarget

StaticBalancer always returns the host specified by the user

func (*StaticBalancer) RemoveTarget

func (b *StaticBalancer) RemoveTarget(string) bool

RemoveTarget doesn't do anything but return true

Jump to

Keyboard shortcuts

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