Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = wrappedCfg{ Http: Config{ ListenAddr: "0.0.0.0", ListenPort: 3000, LogAllRequest: true, CORS: CorsSetting{ AllowOrigins: []string{"*"}, AllowHeaders: []string{"Accept", "Content-Type", "Content-Length", "Accept-Encoding", "Authorization", "ResponseType"}, }, H2c: false, }, }
Functions ¶
func CheckConfig ¶
Types ¶
type Config ¶
type Config struct {
ListenAddr string `mapstructure:"listen-addr" validate:"required,ip"`
ListenPort int `mapstructure:"listen-port" validate:"required,gt=0,lte=65535"`
LogAllRequest bool `mapstructure:"log-all-request"`
LogIgnorePaths []string `mapstructure:"log-ignore-paths"`
CORS CorsSetting `mapstructure:"cors"`
H2c bool `mapstructure:"h2c"`
}
type CorsSetting ¶
type HttpOptions ¶
func BeforeHttp ¶
func BeforeHttp() HttpOptions
Click to show internal directories.
Click to hide internal directories.