Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CORSMiddleware ¶
func CORSMiddleware(conf CORSConfig) func(c CtrlFunc) CtrlFunc
CORSMiddleware setting Cross-Origin Resource Sharing (CORS)
func RecoveryMiddleware ¶
RecoveryMiddleware recovery go panic and write to log
func ThrottlingMiddleware ¶
ThrottlingMiddleware limits active requests
Types ¶
type CORSConfig ¶
type CORSConfig struct {
Age int `yaml:"age"`
Origin []string `yaml:"origin"`
Methods []string `yaml:"methods"`
Headers []string `yaml:"headers"`
}
CORSConfig model
type CtrlFunc ¶
type CtrlFunc func(http.ResponseWriter, *http.Request)
CtrlFunc interface of controller
Click to show internal directories.
Click to hide internal directories.