Documentation
¶
Index ¶
Constants ¶
View Source
const ( ExitSuccess = 0 ExitFailure = 1 )
Variables ¶
This section is empty.
Functions ¶
func ParseFlagsAndConfig ¶
func ParseFlagsAndConfig()
ParseFlagsAndConfig parses the CLI flags provided to the executable and tries to load the config from the YAML file. Prints any error during parsing or config loading to os.Stderr and exits.
Types ¶
type ConfigFile ¶
type ConfigFile struct {
Listen string `yaml:"listen" default:"localhost:5680"`
DebugPassword string `yaml:"debug-password"`
ChannelsDir string `yaml:"channels-dir"`
ApiTimeout time.Duration `yaml:"api-timeout" default:"1m"`
Icingaweb2URL string `yaml:"icingaweb2-url"`
Database database.Config `yaml:"database"`
Logging logging.Config `yaml:"logging"`
}
func Config ¶
func Config() *ConfigFile
Config returns the config that was loaded while starting the daemon. Panics when ParseFlagsAndConfig was not called earlier.
func (*ConfigFile) SetDefaults ¶
func (c *ConfigFile) SetDefaults()
SetDefaults implements the defaults.Setter interface.
func (*ConfigFile) Validate ¶
func (c *ConfigFile) Validate() error
Validate implements the config.Validator interface. Validates the entire daemon configuration on daemon startup.
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"`
}
Flags defines the CLI flags supported by Icinga Notifications.
Click to show internal directories.
Click to hide internal directories.