Documentation ¶
Index ¶
- Variables
- func BasicAuth(valid func(string, string) bool) forest.HandlerFunc
- func BasicAuthWithConfig(config BasicAuthConfig) forest.HandlerFunc
- func Cors() forest.HandlerFunc
- func CorsWithConfig(config CorsConfig) forest.HandlerFunc
- func Logger() forest.HandlerFunc
- func LoggerWithConfig(config LoggerConfig) forest.HandlerFunc
- func NoCache() forest.HandlerFunc
- func NoCacheWithConfig(config NoCacheConfig) forest.HandlerFunc
- func Options() forest.HandlerFunc
- func Recover() forest.HandlerFunc
- func Skip(m forest.HandlerFunc, skips ...Skipper) forest.HandlerFunc
- func WrapHandler(h http.Handler) forest.HandlerFunc
- type BasicAuthConfig
- type CorsConfig
- type LoggerConfig
- type LoggerFormatter
- type NoCacheConfig
- type Skipper
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultBasicAuthConfig = BasicAuthConfig{ Realm: "Restricted", Validator: func(user, pass string) bool { return false }, } )
View Source
var ( DefaultCorsConfig = CorsConfig{ AllowOrigins: []string{"*"}, AllowMethods: []string{http.MethodGet, http.MethodHead, http.MethodPut, http.MethodPatch, http.MethodPost, http.MethodDelete}, AllowHeaders: []string{"*"}, } )
View Source
var ( DefaultLoggerConfig = LoggerConfig{ Output: os.Stdout, Formatter: newLoggerFormatter, } )
View Source
var ( DefaultNoCacheConfig = NoCacheConfig{ Headers: map[string]string{ "Cache-Control": "no-cache;no-store", }, } )
Functions ¶
func BasicAuthWithConfig ¶
func BasicAuthWithConfig(config BasicAuthConfig) forest.HandlerFunc
func Cors ¶
func Cors() forest.HandlerFunc
func CorsWithConfig ¶
func CorsWithConfig(config CorsConfig) forest.HandlerFunc
func Logger ¶
func Logger() forest.HandlerFunc
func LoggerWithConfig ¶
func LoggerWithConfig(config LoggerConfig) forest.HandlerFunc
func NoCache ¶
func NoCache() forest.HandlerFunc
func NoCacheWithConfig ¶
func NoCacheWithConfig(config NoCacheConfig) forest.HandlerFunc
func Options ¶
func Options() forest.HandlerFunc
func Recover ¶
func Recover() forest.HandlerFunc
func Skip ¶
func Skip(m forest.HandlerFunc, skips ...Skipper) forest.HandlerFunc
func WrapHandler ¶
func WrapHandler(h http.Handler) forest.HandlerFunc
Types ¶
type BasicAuthConfig ¶
type CorsConfig ¶
type LoggerConfig ¶
type LoggerConfig struct { Skipper Skipper Output io.Writer Formatter func() LoggerFormatter }
type LoggerFormatter ¶
type NoCacheConfig ¶
Click to show internal directories.
Click to hide internal directories.