Documentation
¶
Index ¶
- Variables
- func BasicAuth(username string, password string) func(http.Handler) http.Handler
- func BasicAuthFunc(authfn func(string, string, *http.Request) bool) func(http.Handler) http.Handler
- func Buffer() func(http.Handler) http.Handler
- func GorillaLog() func(http.Handler) http.Handler
- func Json() func(http.Handler) http.Handler
- func NegroniGzip(compression int) func(http.Handler) http.Handler
- func NegroniLogrus() func(http.Handler) http.Handler
- func Nosurf() func(http.Handler) http.Handler
- func SecureCompare(given string, actual string) bool
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var BasicRealm = "Authorization Required"
BasicRealm is used when setting the WWW-Authenticate response header.
Functions ¶
func BasicAuth ¶
Basic returns a Handler that authenticates via Basic Auth. Writes a http.StatusUnauthorized if authentication fails
func BasicAuthFunc ¶
BasicAuthFunc returns a Handler that authenticates via Basic Auth using the provided function. The function should return true for a valid username/password combination.
func Buffer ¶
Middleware that buffers all http output. This permits output to be written before headers are sent. Downside: no output is sent until it's all ready to be sent, so this breaks streaming.
Note: currently ignores errors
func SecureCompare ¶
SecureCompare performs a constant time compare of two strings to limit timing attacks.
Types ¶
Click to show internal directories.
Click to hide internal directories.