grafana/pkg/services/alerting/interfaces.go
bergquist bd010289b2 alerting: images in alert notifications is now optional
its now possible to turn of image uploading in alert notifications
for those who operate on very sensitive data.

closes #7419
2017-02-15 14:17:36 +01:00

46 lines
768 B
Go

package alerting
import "time"
type EvalHandler interface {
Eval(evalContext *EvalContext)
}
type Scheduler interface {
Tick(time time.Time, execQueue chan *Job)
Update(rules []*Rule)
}
type Notifier interface {
Notify(evalContext *EvalContext) error
GetType() string
NeedsImage() bool
PassesFilter(rule *Rule) bool
GetNotifierId() int64
GetIsDefault() bool
}
type NotifierSlice []Notifier
func (notifiers NotifierSlice) ShouldUploadImage() bool {
for _, notifier := range notifiers {
if notifier.NeedsImage() {
return true
}
}
return false
}
type ConditionResult struct {
Firing bool
NoDataFound bool
Operator string
EvalMatches []*EvalMatch
}
type Condition interface {
Eval(result *EvalContext) (*ConditionResult, error)
}