Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultAuthScheme default authentication scheme for JWT tokens. DefaultAuthScheme = "Bearer" // DefaultAuthHeaderName default header to load the JWT. DefaultAuthHeaderName = "Authorization" // DefaultContextVar the variable in the context to store the JWT token after successful login. DefaultContextVar = "user" )
Variables ¶
View Source
var ( // ErrJWTMissing missing or malformed jwt. ErrJWTMissing = echo.NewHTTPError(http.StatusBadRequest, "missing or malformed jwt") // ErrJWTValidation invalid jwt. ErrJWTValidation = echo.NewHTTPError(http.StatusUnauthorized, "invalid jwt") )
Functions ¶
func ErrorLog ¶
func ErrorLog(next echo.HandlerFunc) echo.HandlerFunc
ErrorLog middleware which logs each error.
func JWTWithConfig ¶
func JWTWithConfig(config *JWTConfig) echo.MiddlewareFunc
JWTWithConfig middleware which validates tokens.
func RequestID ¶
func RequestID(next echo.HandlerFunc) echo.HandlerFunc
RequestID middleware which checks request id.
func RequestLog ¶
func RequestLog(next echo.HandlerFunc) echo.HandlerFunc
RequestLog middleware which logs each request.
Types ¶
Click to show internal directories.
Click to hide internal directories.