Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { // Executor of action: shell, jenkins, etc. Executor string `mapstructure:"executor"` // CommonParameters represents string for Config.CommonParameters map. CommonParameters string `mapstructure:"common_parameters"` // Parameters for TaskExecutor. Parameters map[string]interface{} `mapstructure:"parameters"` // Block time after action success execute. Block time.Duration `mapstructure:"block"` // TaskExecutor for this action. TaskExecutor executor.TaskExecutor `mapstructure:"-"` }
Action describes direct action as an reaction of alert.
type Alerts ¶
type Alerts []alert
Alerts is a slice of Alert.
func (Alerts) ToTasksGroups ¶
func (alerts Alerts) ToTasksGroups(rules Rules, eventID string) (tasksGroups TasksGroups)
ToTasksGroups converts alerts to tasks.
type Conditions ¶
type Conditions struct { // AlertStatus is a status of alert. By default set by setDefaultAlertStatus() function. AlertStatus string `mapstructure:"alert_status"` // AlertLabels is a map label-value for match labels. AlertLabels map[string]string `mapstructure:"alert_labels"` // AlertLabelsRegexp is a compiled AlertLabels. AlertLabelsRegexp map[string]*regexp.Regexp `mapstructure:"-"` // AlertAnnotations is a map annotation-value for match annotations. AlertAnnotations map[string]string `mapstructure:"alert_annotations"` // AlertAnnotationsRegexp is a compiled AlertAnnotations. AlertAnnotationsRegexp map[string]*regexp.Regexp `mapstructure:"-"` }
Conditions describes
type Rule ¶
type Rule struct { // Name of the rule, used for metrics, logger. Name string `mapstructure:"name"` // Conditions for rule match. Conditions Conditions `mapstructure:"conditions"` // Actions is a slice of action. Actions Actions `mapstructure:"actions"` }
Rule describes rule for alerts.
type Tasks ¶
Tasks is a slice of executor.Task.
type TasksGroups ¶
type TasksGroups []Tasks
TasksGroups is a slice of Tasks.
func (TasksGroups) Details ¶
func (tasksGroups TasksGroups) Details() [][]map[string]interface{}
Details gets details for all tasks groups.
Click to show internal directories.
Click to hide internal directories.