Documentation ¶
Overview ¶
Package middleware contains middleware which is called before the actual http handler and provides filtering or context.
Index ¶
- func AuthenticatedFilter(loginURL string) func(next xhandler.HandlerC) xhandler.HandlerC
- func JSONWrapper() func(next xhandler.HandlerC) xhandler.HandlerC
- func UnauthenticatedFilter(loggedInURL string) func(next xhandler.HandlerC) xhandler.HandlerC
- func UserContext() func(next xhandler.HandlerC) xhandler.HandlerC
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticatedFilter ¶
AuthenticatedFilter filters logged in users. Users with an invalid session are redirected to the loginURL.
func JSONWrapper ¶
JSONWrapper sets the content-type of the response to json.
func UnauthenticatedFilter ¶
UnauthenticatedFilter filters not-logged in users. Users with a valid session are redirected to the loggedInURL.
Types ¶
Click to show internal directories.
Click to hide internal directories.