Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultListen = ":8080" DefaultServerName = "fasthttpd" MatchPrefix = "prefix" MatchEqual = "equal" MatchRegexp = "regexp" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessLog ¶
type AccessLog struct {
Output string `yaml:"output"`
Format string `yaml:"format"`
Rotation Rotation
}
AccessLog represents a configuration of access log.
func (AccessLog) SetDefaults ¶ added in v0.1.0
type Config ¶
type Config struct {
Host string `yaml:"host"`
Listen string `yaml:"listen"`
SSL SSL `yaml:"ssl"`
Root string `yaml:"root"`
Server tree.Map `yaml:"server"`
Log Log `yaml:"log"`
AccessLog AccessLog `yaml:"accessLog"`
ErrorPages map[string]string `yaml:"errorPages"`
Filters map[string]tree.Map `yaml:"filters"`
Handlers map[string]tree.Map `yaml:"handlers"`
Routes []Route `yaml:"routes"`
RoutesCache RoutesCache `yaml:"routesCache"`
}
Config represents a configuration root of fasthttpd.
func UnmarshalYAML ¶
func UnmarshalYAMLPath ¶
func (Config) SetDefaults ¶ added in v0.1.0
type Log ¶
type Log struct {
Output string `yaml:"output"`
Prefix string `yaml:"prefix"`
Flags []string `yaml:"flags"`
Rotation Rotation
}
Log represents a configuration of logging.
func (Log) SetDefaults ¶ added in v0.1.0
type Rotation ¶ added in v0.1.0
type Rotation struct {
MaxSize int `yaml:"maxSize"`
MaxBackups int `yaml:"maxBackups"`
MaxAge int `yaml:"maxAge"`
Compress bool `yaml:"compress"`
LocalTime bool `yaml:"localTime"`
}
Rotation represents a configuration of log rotation.
func (Rotation) SetDefaults ¶ added in v0.1.0
type Route ¶
type Route struct {
Path string `yaml:"path"`
Match string `yaml:"match"`
Methods []string `yaml:"methods"`
Filters []string `yaml:"filters"`
Rewrite string `yaml:"rewrite"`
RewriteAppendQueryString bool `yaml:"rewriteAppendQueryString"`
Handler string `yaml:"handler"`
Status int `yaml:"status"`
StatusMessage string `yaml:"statusMessage"`
}
Route represents a configuration of route.
type RoutesCache ¶
type RoutesCache struct {
Enable bool `yaml:"enable"`
Expire int `yaml:"expire"`
Interval int `yaml:"interval"`
}
RoutesCache represents a configuration of route cache.
Click to show internal directories.
Click to hide internal directories.