Documentation
¶
Index ¶
- func BasicAuth(validate BasicAuthValidate, opts ...BasicAuthOption) func(http.Handler) http.Handler
- func BasicAuthHandler(next http.Handler, validate BasicAuthValidate, opts ...BasicAuthOption) http.Handler
- func CombinedLogging(out io.Writer) func(http.Handler) http.Handler
- func Compress(level int) func(http.Handler) http.Handler
- func CustomerLogging(out io.Writer, formatter handlers.LogFormatter) func(http.Handler) http.Handler
- func GetBasicAuthUser(r *http.Request) string
- func Header(f HeaderFunc) func(http.Handler) http.Handler
- func Logging(out io.Writer) func(http.Handler) http.Handler
- type BasicAuthOption
- type BasicAuthValidate
- type HeaderFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuth ¶
func BasicAuth(validate BasicAuthValidate, opts ...BasicAuthOption) func(http.Handler) http.Handler
BasicAuth returns a basic auth middleware.
func BasicAuthHandler ¶
func BasicAuthHandler(next http.Handler, validate BasicAuthValidate, opts ...BasicAuthOption) http.Handler
BasicAuthHandler returns a basic auth handler.
func CombinedLogging ¶
CombinedLogging is a combined logging middleware.
func CustomerLogging ¶
func CustomerLogging(out io.Writer, formatter handlers.LogFormatter) func(http.Handler) http.Handler
CustomerLogging is a customer logging middleware.
func GetBasicAuthUser ¶
GetBasicAuthUser returns the basic auth username.
Types ¶
type BasicAuthOption ¶
type BasicAuthOption func(*basicAuth)
BasicAuthOption is a function that apply on basic auth.
func BasicAuthErrorHandler ¶
func BasicAuthErrorHandler(h http.Handler) BasicAuthOption
BasicAuthErrorHandler is an option to handle validation failed.
func BasicAuthRealm ¶
func BasicAuthRealm(v string) BasicAuthOption
BasicAuthRealm is an option to sets realm.
type BasicAuthValidate ¶
BasicAuthValidate is a function that validate username and password.
type HeaderFunc ¶
HeaderFunc is a function that recieves a http.Header.
Click to show internal directories.
Click to hide internal directories.