Documentation
¶
Index ¶
- func CacheControl(maxAge time.Duration) echo.MiddlewareFunc
- func LoadAuthenticatedUser(authClient *services.AuthClient) echo.MiddlewareFunc
- func LoadUser(orm *ent.Client) echo.MiddlewareFunc
- func LoadValidPasswordToken(authClient *services.AuthClient) echo.MiddlewareFunc
- func LogRequest() echo.MiddlewareFunc
- func RequireAuthentication() echo.MiddlewareFunc
- func RequireNoAuthentication() echo.MiddlewareFunc
- func ServeCachedPage(t *services.TemplateRenderer) echo.MiddlewareFunc
- func Session(store sessions.Store) echo.MiddlewareFunc
- func SetLogger() echo.MiddlewareFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheControl ¶
CacheControl sets a Cache-Control header with a given max age
func LoadAuthenticatedUser ¶
func LoadAuthenticatedUser(authClient *services.AuthClient) echo.MiddlewareFunc
LoadAuthenticatedUser loads the authenticated user, if one, and stores in context
func LoadValidPasswordToken ¶
func LoadValidPasswordToken(authClient *services.AuthClient) echo.MiddlewareFunc
LoadValidPasswordToken loads a valid password token entity that matches the user and token provided in path parameters If the token is invalid, the user will be redirected to the forgot password route This requires that the user owning the token is loaded in to context
func LogRequest ¶ added in v0.13.0
func LogRequest() echo.MiddlewareFunc
LogRequest logs the current request Echo provides middleware similar to this, but we want to use our own logger
func RequireAuthentication ¶
func RequireAuthentication() echo.MiddlewareFunc
RequireAuthentication requires that the user be authenticated in order to proceed
func RequireNoAuthentication ¶
func RequireNoAuthentication() echo.MiddlewareFunc
RequireNoAuthentication requires that the user not be authenticated in order to proceed
func ServeCachedPage ¶
func ServeCachedPage(t *services.TemplateRenderer) echo.MiddlewareFunc
ServeCachedPage attempts to load a page from the cache by matching on the complete request URL If a page is cached for the requested URL, it will be served here and the request terminated. Any request made by an authenticated user or that is not a GET will be skipped.
func SetLogger ¶ added in v0.13.0
func SetLogger() echo.MiddlewareFunc
SetLogger initializes a logger for the current request and stores it in the context. It's recommended to have this executed after Echo's RequestID() middleware because it will add the request ID to the logger so that all log messages produced from this request have the request ID in it. You can modify this code to include any other fields that you want to always appear.
Types ¶
This section is empty.