Documentation ¶
Overview ¶
Package mw defines various pieces of middleware that conform to the http.Handler and the httprouter.Handle interfaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoKey = errors.New("HEYAPPLE_CSRF_KEY environment variable not found. Using insecure default value. Do NOT run this in a production environment!") ErrNoSecure = errors.New("HEYAPPLE_CSRF_SECURE environment variable not found. CSRF cookies will be sent over insecure connections. Do NOT run this in a production environment!") ErrNotSecure = errors.New("HEYAPPLE_CSRF_SECURE is set to 'false'. CSRF cookies will be sent over insecure connections. Do NOT run this in a production environment!") )
Functions ¶
Types ¶
type Func ¶
type Func func(httprouter.Handle) httprouter.Handle
func Anon ¶
func Anon(env *handler.Environment, target string) Func
Anon is a middleware that prevents logged-in users from accessing a resource.
Click to show internal directories.
Click to hide internal directories.