config

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2025 License: GPL-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultConfigPath = "/etc/icingadb/config.yml"

DefaultConfigPath specifies the default location of Icinga DB's config.yml for package installations.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Database  database.Config `yaml:"database" envPrefix:"DATABASE_"`
	Redis     redis.Config    `yaml:"redis" envPrefix:"REDIS_"`
	Logging   logging.Config  `yaml:"logging" envPrefix:"LOGGING_"`
	Retention RetentionConfig `yaml:"retention" envPrefix:"RETENTION_"`
}

Config defines Icinga DB config.

func (*Config) SetDefaults

func (c *Config) SetDefaults()

func (*Config) Validate

func (c *Config) Validate() error

Validate checks constraints in the supplied configuration and returns an error if they are violated.

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. If not provided, it defaults to DefaultConfigPath.
	Config string `short:"c" long:"config" description:"path to config file (default: /etc/icingadb/config.yml)"`

	// DatabaseAutoImport results in an initial schema check and update; mostly for containerized setups.
	DatabaseAutoImport bool `long:"database-auto-import" description:"import database schema on startup if database is empty"`

	// DatabaseSchemaDir is the root directory for schema files to be used when DatabaseAutoImport is requested.
	//
	// The directory structure must mimic the git repo's schema dir, containing ./mysql/schema.sql and ./pgsql/schema.sql.
	DatabaseSchemaDir string `` /* 136-byte string literal not displayed */
}

Flags defines CLI flags.

Flags implements the github.com/icinga/icinga-go-library/config.Flags interface.

func (Flags) GetConfigPath added in v1.3.0

func (f Flags) GetConfigPath() string

GetConfigPath retrieves the path to the configuration file. It returns the path specified via the command line, or DefaultConfigPath if none is provided.

GetConfigPath implements parts of the github.com/icinga/icinga-go-library/config.Flags interface.

func (Flags) IsExplicitConfigPath added in v1.3.0

func (f Flags) IsExplicitConfigPath() bool

IsExplicitConfigPath indicates whether the configuration file path was explicitly set.

IsExplicitConfigPath implements parts of the github.com/icinga/icinga-go-library/config.Flags interface.

type RetentionConfig

type RetentionConfig struct {
	HistoryDays uint16                   `yaml:"history-days" env:"HISTORY_DAYS"`
	SlaDays     uint16                   `yaml:"sla-days" env:"SLA_DAYS"`
	Interval    time.Duration            `yaml:"interval" env:"INTERVAL" default:"1h"`
	Count       uint64                   `yaml:"count" env:"COUNT" default:"5000"`
	Options     history.RetentionOptions `yaml:"options" env:"OPTIONS"`
}

RetentionConfig defines configuration for history retention.

func (*RetentionConfig) Validate

func (r *RetentionConfig) Validate() error

Validate checks constraints in the supplied retention configuration and returns an error if they are violated.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL