Documentation ¶
Index ¶
- Variables
- func CSRF(lookupName, path string, authKey []byte) echo.MiddlewareFunc
- func FillContext(fillers ...fillcontext.Filler) echo.MiddlewareFunc
- func ID(prefix string) echo.MiddlewareFunc
- func Log(logger log.Interface) echo.MiddlewareFunc
- func Noop(next echo.HandlerFunc) echo.HandlerFunc
- func Normalize(mode NormalizationMode) echo.MiddlewareFunc
- func Recover() echo.MiddlewareFunc
- type NormalizationMode
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrHTTPRecovered = errors.DefineInternal("http_recovered", "Internal Server Error")
ErrHTTPRecovered is returned when a panic is caught from an HTTP handler.
Functions ¶
func CSRF ¶ added in v3.9.0
func CSRF(lookupName, path string, authKey []byte) echo.MiddlewareFunc
CSRF adds cross-site request forgery protection to the handler. The sync token is passed to the template to be picked up by JavaScript.
func FillContext ¶
func FillContext(fillers ...fillcontext.Filler) echo.MiddlewareFunc
FillContext fills the request context by executing the given fillers.
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.
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 )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.