Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseConfig ¶
type DatabaseConfig struct { Username string `yaml:"username"` Password string `yaml:"password"` URL string `yaml:"url"` Port int `yaml:"port"` // Name defines database name Name string `yaml:"name"` // MaxIdleConns connection pool conns, default is 2 MaxIdleConns int `yaml:"maxIdleConns"` // MaxOpenConns sets the maximum number of open connections to the database. The default is 10. MaxOpenConns int `yaml:"maxOpenConns"` }
DatabaseConfig defines database connection info
func (*DatabaseConfig) Format ¶
func (d *DatabaseConfig) Format() string
Format is stringify DatabaseConfig
type ExtraConfig ¶
ExtraConfig defines extra config
type GlobalConfig ¶
type GlobalConfig struct { DatabaseConfig DatabaseConfig `yaml:"databaseConfig"` PrometheusConfig PrometheusConfig `yaml:"prometheusConfig"` ExtraConfig ExtraConfig `yaml:"extraConfig"` }
GlobalConfig defines global config
func Unmarshal ¶
func Unmarshal(filename string) (*GlobalConfig, error)
Unmarshal defines how to parse file
type PrometheusConfig ¶
type PrometheusConfig struct {
Address string `yaml:"address"`
}
PrometheusConfig defines which prometheus to connect
Click to show internal directories.
Click to hide internal directories.