middlewares

package
v0.0.0-...-82de52e Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TxnHeader allow to trace logs of a request
	TxnHeader = "X-App-Txn"
	// UnknownPath path label for all 404 answers (path not found)
	UnknownPath = "unknown_path"
)

Variables

This section is empty.

Functions

func CORS

func CORS() echo.MiddlewareFunc

CORS handle preflight request the default middleware is not used because we have to set dynamically the origin

func Deny

func Deny(tokens []string) echo.MiddlewareFunc

Deny is a middleware that check tokens and deny if there are in configuration

func Gzip

func Gzip() echo.MiddlewareFunc

Gzip gunzip request before handlers

func Logger

func Logger() echo.MiddlewareFunc

Logger middleware

func Native

func Native(h func(http.ResponseWriter, *http.Request)) echo.HandlerFunc

Native wrap native handler to echo handler @see echo.WrapHandler

func Protocol

func Protocol(name string) echo.MiddlewareFunc

Protocol middleware

func ReverseWithConfig

func ReverseWithConfig(config ReverseConfig) echo.HandlerFunc

ReverseWithConfig execute a reverse proxy using the configuration given in parameters

Types

type ReverseConfig

type ReverseConfig struct {
	Path string
	URL  string
}

ReverseConfig is the configuration to describe a reverse proxy

Jump to

Keyboard shortcuts

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