Documentation ¶
Index ¶
- Variables
- func FillContext(fillers ...fillcontext.Filler) echo.MiddlewareFunc
- func ID(prefix string) echo.MiddlewareFunc
- func Immutable(next echo.HandlerFunc) echo.HandlerFunc
- func Log(logger log.Interface) echo.MiddlewareFunc
- func Noop(next echo.HandlerFunc) echo.HandlerFunc
- func Normalize(mode NormalizationMode) echo.MiddlewareFunc
- func Recover() echo.MiddlewareFunc
- func RedirectToHTTPS(fromToPorts map[int]int) echo.MiddlewareFunc
- func RedirectToHost(target string) echo.MiddlewareFunc
- type NormalizationMode
Constants ¶
This section is empty.
Variables ¶
var ErrHTTPRecovered = errors.DefineInternal("http_recovered", "Internal Server Error")
ErrHTTPRecovered is returned when a panic is caught from an HTTP handler.
Functions ¶
func FillContext ¶
func FillContext(fillers ...fillcontext.Filler) echo.MiddlewareFunc
FillContext fills the request context by executing the given fillers.
func Immutable ¶
func Immutable(next echo.HandlerFunc) echo.HandlerFunc
Immutable set the Cache-Control header to make the resource immutable. This means the client will never try to revalidate the resource.
func Log ¶
func Log(logger log.Interface) echo.MiddlewareFunc
Log is middleware that logs the request.
func Normalize ¶
func Normalize(mode NormalizationMode) echo.MiddlewareFunc
Normalize is middleware that normalizes the url and redirects the request if necessary.
func Recover ¶
func Recover() echo.MiddlewareFunc
Recover returns Echo middleware that recovers from panics.
func RedirectToHTTPS ¶
func RedirectToHTTPS(fromToPorts map[int]int) echo.MiddlewareFunc
RedirectToHTTPS redirects requests from HTTP to HTTPS.
func RedirectToHost ¶
func RedirectToHost(target string) echo.MiddlewareFunc
RedirectToHost redirects to the target host if not already used. The port of the request is preserved.
Types ¶
type NormalizationMode ¶
type NormalizationMode int
NormalizationMode describes how to normalize the request url.
const ( // Ignore is the normalization mode where no action is taken. Ignore NormalizationMode = iota // RedirectPermanent is the normalization mode where the client is redirected with 301 or 308. RedirectPermanent // RedirectTemporary is the normalization mode where the client is redirected with 302 or 307. RedirectTemporary // Continue is the normalization mode where the request url is updated but the request can just be handled. Continue )