Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIsADirectory = errors.New("is a directory, not a normal file")
Functions ¶
func ParseFlags ¶
ParseFlags will create and parse the CLI flags and return the path to be used elsewhere.
func ValidateConfigPath ¶
ValidateConfigPath just makes sure, that the path provided is a file, that can be read.
Types ¶
type Config ¶
type Config struct {
Server struct {
// Host is the local machine IP Address to bind the HTTP Server to
Host string `yaml:"host"`
// Port is the local machine TCP Port to bind the HTTP Server to
Port string `yaml:"port"`
Timeout struct {
// Server is the general server timeout to use
// for graceful shutdowns
Server time.Duration `yaml:"server"`
// Write is the amount of time to wait until an HTTP server
// write operation is cancelled
Write time.Duration `yaml:"write"`
// Read is the amount of time to wait until an HTTP server
// read operation is cancelled
Read time.Duration `yaml:"read"`
// Read is the amount of time to wait
// until an IDLE HTTP session is closed
Idle time.Duration `yaml:"idle"`
// Request is the amount of time to wait
// until a request is aborted if the context is blocking
Request time.Duration `yaml:"request"`
} `yaml:"timeout"`
// MaxRequestBodySize can be specified as `4x` or `4xB`, where x is one of the multiple from K, M,
// G, T or P.
MaxRequestBodySize string `yaml:"maxRequestBodySize"`
CORS struct {
AllowOrigins []string `yaml:"allowOrigins"`
AllowHeaders []string `yaml:"allowHeaders"`
} `yaml:"cors"`
} `yaml:"server"`
SQL struct {
DataSource string `yaml:"dataSource"`
}
password.PasswordGenerator `yaml:"-"`
service.UsernameGenerator `yaml:"-"`
LogSettings `yaml:"log"`
Services struct {
service.Accounts
} `yaml:"-"`
}
Config struct for webapp config.
type LogSettings ¶
type LogSettings struct {
Format LogSettingsFormat `yaml:"format"`
}
type LogSettingsFormat ¶
type LogSettingsFormat string
const ( LogSettingsFormatJSON LogSettingsFormat = "json" LogSettingsFormatPretty LogSettingsFormat = "pretty" LogSettingsFormatNone LogSettingsFormat = "" )
Click to show internal directories.
Click to hide internal directories.