interfaces.go 552 B

1234567891011121314151617181920212223242526272829303132
  1. package alerting
  2. import "time"
  3. type EvalHandler interface {
  4. Eval(evalContext *EvalContext)
  5. }
  6. type Scheduler interface {
  7. Tick(time time.Time, execQueue chan *Job)
  8. Update(rules []*Rule)
  9. }
  10. type Notifier interface {
  11. Notify(evalContext *EvalContext) error
  12. GetType() string
  13. NeedsImage() bool
  14. PassesFilter(rule *Rule) bool
  15. GetNotifierId() int64
  16. GetIsDefault() bool
  17. }
  18. type ConditionResult struct {
  19. Firing bool
  20. NoDataFound bool
  21. EvalMatches []*EvalMatch
  22. }
  23. type Condition interface {
  24. Eval(result *EvalContext) (*ConditionResult, error)
  25. }