Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompilePatterns ¶
CompilePatterns compiles the patterns from string to Regexp. In addition it returns the list of patterns that cannot be compiled
func GetFileBytes ¶
GetFileBytes retrieves a file by URL and returns its text content
Types ¶
type Config ¶
type Config struct {
Spec []patternSpec `yaml:"spec"`
}
Config stores all information read from the config yaml
func ParseDefaultConfig ¶
ParseYaml reads the default config and returns the Config struct
func (Config) CollectErrorPatterns ¶
CollectErrorPatterns collects and returns all error patterns in the yaml file
func (*Config) GetAllPatterns ¶
GetAllPatterns collects all regexp patterns, including both error message patterns and job name patterns
func (Config) GetPatternAlertConditions ¶
func (c Config) GetPatternAlertConditions(pattern string) map[string]*SelectedConfig
GetPatternAlertConditions takes an error pattern and returns a map with job regex to the alerting condition
type SelectedConfig ¶
type SelectedConfig struct { Hint string Occurrences int JobsAffected int PrsAffected int Period int }
SelectedConfig stores the recovery hint as well as alert conditions for a selected error pattern and qualifying job name
func (SelectedConfig) Duration ¶
func (s SelectedConfig) Duration() time.Duration
Duration converts the time period stored as minutes int to a Duration object