Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultConfig is the default top-level configuration. DefaultConfig = Config{ Global: DefaultGlobalConfig, Metrics: DefaultMetricsConfig, } // DefaultGlobalConfig is the default global configuration. DefaultGlobalConfig = GlobalConfig{ Retries: 3, Delta: 60, } // DefaultMetricsConfig is the default metrics configuration. DefaultMetricsConfig = MetricsConfig{ Enable: false, Address: "127.0.0.1:8337", } )
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check struct {
// contains filtered or unexported fields
}
Check representation
func (*Check) GetNotifier ¶
GetNotifier returns the notifier from the current check
type CheckConfig ¶
type CheckConfig struct { Title string `yaml:"title"` Notifier string `yaml:"notifier"` Processor ProcessorConfig `yaml:"processor"` }
CheckConfig struct for a check parameters
type ChecksConfig ¶
type ChecksConfig struct {
Checks []CheckConfig `yaml:"checks"`
}
ChecksConfig struct for a checks file
type Config ¶
type Config struct { Global GlobalConfig `yaml:"global"` Metrics MetricsConfig `yaml:"metrics"` ChecksFolder string `yaml:"checks_folder"` Notifiers []NotifierConfig `yaml:"notifiers"` }
Config struct for the main configuration file
func (*Config) GetChecks ¶
func (c *Config) GetChecks() ([]CheckConfig, error)
GetChecks returns the config for all checks inside the directory
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container contains checks and notifiers
func NewContainer ¶
NewContainer creates a new container
func (*Container) GetMetrics ¶ added in v0.0.12
GetMetrics return the HTTP address for the Prometheus endpoint
func (*Container) GetNotifier ¶
GetNotifier returns a notifier with a dedicated name
func (*Container) GetRetries ¶
GetRetries returns the number of retries before sending notifications
type GlobalConfig ¶
type GlobalConfig struct { Delta uint `yaml:"delta,omitempty"` Retries uint `yaml:"retries,omitempty"` }
GlobalConfig struct for global parameters
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader loads elements into the container from the config
func (*Loader) LoadChecks ¶
func (l *Loader) LoadChecks(container *Container, configs []CheckConfig) error
LoadChecks loads checks from the config into the container
func (*Loader) LoadNotifiers ¶
func (l *Loader) LoadNotifiers(container *Container, configs []NotifierConfig) error
LoadNotifiers loads notifiers from the config into the container
type MetricsConfig ¶ added in v0.0.12
type MetricsConfig struct { Enable bool `yaml:"enable,omitempty"` Address string `yaml:"address,omitempty"` }
MetricsConfig struct for Prometheus metrics parameters
type NotifierConfig ¶
type NotifierConfig struct { Name string `yaml:"name"` Kind string `yaml:"kind"` Data map[string]string `yaml:"data"` }
NotifierConfig struct for a notifier parameters
type ProcessorConfig ¶
ProcessorConfig struct for a processor parameters