config

package
v0.0.0-...-8ca999e Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ALERT_ROOT    = "alerts"
	SILENCES_LEAF = "silences"
	ACK_LEAF      = "acks"
)

Variables

This section is empty.

Functions

func RegisterNodes

func RegisterNodes()

Types

type ConfigFile

type ConfigFile struct {
	// contains filtered or unexported fields
}

func LoadConfigFile

func LoadConfigFile(path string, logger zerolog.Logger) (*ConfigFile, error)

LoadConfigFile reads the given file, and parses it into a config, returning any parsing errors.

func (*ConfigFile) GetNotifiersForAlert

func (c *ConfigFile) GetNotifiersForAlert(ctx context.Context, a *model.Alert) []config.NotifierSettings

GetNotifiersForAlert walks the config graph, building up notification settings as we go before returning a list of notifiers we hit along the way. We expect here that the ConfigFile has been passed through `Validate` already, and thus is assumed to have no cycles.

func (*ConfigFile) Globals

func (c *ConfigFile) Globals() *config.Globals

func (*ConfigFile) Validate

func (c *ConfigFile) Validate() error

Validate returns nil if the config is valid, or an error to be displayed to the user if not.

func (*ConfigFile) ValidateData

func (c *ConfigFile) ValidateData(ctx context.Context, data config.Fielder) error

type HashSet

type HashSet map[string]struct{}

HashSet is a helper type that manages a set of strings.

type Link struct {
	// contains filtered or unexported fields
}

Link represents a connection between nodes, that may or may not have an attached filter.

Jump to

Keyboard shortcuts

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