middleware

package
v1.5.0-alpha5 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorize added in v1.2.1

func Authorize(authorizer authz.Authorizer) echo.MiddlewareFunc

Authorize only allows the HTTP request to continue if the passed authorizer permits the request.

func ChainedSkipper added in v1.2.2

func ChainedSkipper(skippers ...echomiddelware.Skipper) echomiddelware.Skipper

ChainedSkipper creates a skipper that skips if any of the provided skippers returns true

func CustomHTTPErrorHandler added in v1.5.0

func CustomHTTPErrorHandler(err error, c echo.Context)

func Otel

func Otel() echo.MiddlewareFunc

func PathMatchSkipper

func PathMatchSkipper(paths []string) echomiddelware.Skipper

func RequestLogger

func RequestLogger(logger zerolog.Logger, logLevel zerolog.Level) echo.MiddlewareFunc

func ServerHeader added in v1.2.1

func ServerHeader(headers map[string]string) echo.MiddlewareFunc

ServerHeader middleware adds HTTP Headers `headers` to response

func SetContentType

func SetContentType(contentType string) echo.MiddlewareFunc

SetContentType returns a middleware which sets the response content type.

func VersionCheckMiddleware added in v1.4.0

func VersionCheckMiddleware(serverVersion, minVersion semver.Version) echo.MiddlewareFunc

VersionCheckMiddleware returns a middleware that checks if the client version is at least minVersion.

func VersionNotifyLogger added in v1.2.1

func VersionNotifyLogger(logger *zerolog.Logger, serverVersion semver.Version) echo.MiddlewareFunc

func WebsocketSkipper added in v1.2.2

func WebsocketSkipper(c echo.Context) bool

Types

type Notification added in v1.2.1

type Notification struct {
	RequestID     string
	ClientID      string
	ServerVersion string

	ClientVersion string
	Message       string
}

type VersionCheckError added in v1.4.0

type VersionCheckError struct {
	Error         string
	MinVersion    string
	ClientVersion string
	ServerVersion string
}

Jump to

Keyboard shortcuts

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