config

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultListen     = ":8800"
	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"`
}

type Config

type Config struct {
	Host        string              `yaml:"host"`
	Listen      string              `yaml:"listen"`
	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 UnmarshalYAML(data []byte) (Config, error)

func UnmarshalYAMLPath

func UnmarshalYAMLPath(path string) (Config, error)

func (Config) Normalize

func (cfg Config) Normalize() (Config, error)

type Log

type Log struct {
	Output string `yaml:"output"`
}

type Rewrite

type Rewrite struct {
	URI               string `yaml:"uri"`
	AppendQueryString bool   `yaml:"appendQueryString"`
}

type Route

type Route struct {
	Path    string   `yaml:"path"`
	Match   string   `yaml:"match"`
	Methods []string `yaml:"methods"`
	Filters []string `yaml:"filters"`
	Rewrite Rewrite  `yaml:"rewrite"`
	Handler string   `yaml:"handler"`
	Status  Status   `yaml:"status"`
}

type RoutesCache

type RoutesCache struct {
	Enable bool `yaml:"enable"`
	Expire int  `yaml:"expire"`
}

type Status

type Status struct {
	Code    int    `yaml:"code"`
	Message string `yaml:"message"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL