Documentation
¶
Overview ¶
Package config provides types and functions for parsing config file, environment variables and command-line flags.
Index ¶
Constants ¶
View Source
const ( DBTypeSQLite string = "sqlite" DBTypePostgres string = "postgres" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
HTTP HTTP `mapstructure:"http"`
Logger Log `mapstructure:"log"`
Database Database `mapstructure:"database"`
Version string
Build string
}
Config represents the config file.
type Database ¶
type Database struct {
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
Name string `mapstructure:"name"`
User string `mapstructure:"user"`
Password string `mapstructure:"password"`
Timeout int `mapstructure:"timeout"`
MaxConns int32 `mapstructure:"max_conns"`
DBType string `mapstructure:"db_type"`
}
Database represents database section in config file.
type HTTP ¶
type HTTP struct {
Address string `mapstructure:"address"`
Timeout HTTPTimeout `mapstructure:"timeout"`
ShutdownTimeout time.Duration `mapstructure:"shutdown_timeout"`
}
HTTP represents HTTP section in config file.
type HTTPTimeout ¶
HTTPTimeout represents HTTP timeout section in config file.
Click to show internal directories.
Click to hide internal directories.