Documentation
¶
Index ¶
- func CheckCookie(h http.Handler, cookieKey CookieKey) http.Handler
- func CheckCookieMiddleware(cookieKey CookieKey) func(http.Handler) http.Handler
- func CheckHeader(h http.Handler, headerKey HeaderKey) http.Handler
- func CheckHeaderMiddleware(headerKey HeaderKey) func(http.Handler) http.Handler
- type CookieKey
- type HeaderKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCookie ¶
CheckCookie is a wrapper which adds a cookie value to context if one does not yet exist
func CheckCookieMiddleware ¶ added in v1.0.3
CheckCookieMiddleware returns a CheckCookie function for the provided cookie key as a middleware function (alice middleware Constructor, ie. func(http.Handler) -> (http.Handler))
func CheckHeader ¶
CheckHeader is a wrapper which adds a value from the request header to context if one does not yet exist.
func CheckHeaderMiddleware ¶ added in v1.0.3
CheckHeaderMiddleware returns a CheckHeader function for the provided header key as a middleware function (alice middleware Constructor, ie. func(http.Handler) -> (http.Handler))
Types ¶
type CookieKey ¶
type CookieKey int
CookieKey - iota enum of possible cookie keys
Possible values for cookie keys
func (CookieKey) ContextKey ¶
func (ck CookieKey) ContextKey() interface{}
ContextKey returns the context key corresponding to a cookie key