Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Database Database `yaml:"database"`
Redis Redis `yaml:"redis"`
Logging Logging `yaml:"logging"`
Retention Retention `yaml:"retention"`
}
Config defines Icinga DB config.
func FromYAMLFile ¶
FromYAMLFile returns a new Config value created from the given YAML config file.
type Database ¶
type Database struct {
Type string `yaml:"type" default:"mysql"`
Host string `yaml:"host"`
Port int `yaml:"port"`
Database string `yaml:"database"`
User string `yaml:"user"`
Password string `yaml:"password"`
TlsOptions TLS `yaml:",inline"`
Options icingadb.Options `yaml:"options"`
}
Database defines database client configuration.
type Flags ¶
type Flags struct {
// Version decides whether to just print the version and exit.
Version bool `long:"version" description:"print version and exit"`
// Config is the path to the config file
Config string `short:"c" long:"config" description:"path to config file" required:"true" default:"/etc/icingadb/config.yml"`
}
Flags defines CLI flags.
func ParseFlags ¶
ParseFlags parses CLI flags and returns a Flags value created from them.
type Logging ¶
type Logging struct {
// zapcore.Level at 0 is for info level.
Level zapcore.Level `yaml:"level" default:"0"`
Output string `yaml:"output"`
// Interval for periodic logging.
Interval time.Duration `yaml:"interval" default:"20s"`
logging.Options `yaml:"options"`
}
Logging defines Logger configuration.
type Redis ¶
type Redis struct {
Host string `yaml:"host"`
Port int `yaml:"port" default:"6380"`
Password string `yaml:"password"`
TlsOptions TLS `yaml:",inline"`
Options icingaredis.Options `yaml:"options"`
}
Redis defines Redis client configuration.
type Retention ¶
type Retention struct {
HistoryDays uint64 `yaml:"history-days"`
SlaDays uint64 `yaml:"sla-days"`
Interval time.Duration `yaml:"interval" default:"1h"`
Count uint64 `yaml:"count" default:"5000"`
Options history.RetentionOptions `yaml:"options"`
}
Retention defines configuration for history retention.