interfaces.go 624 B

12345678910111213141516171819202122232425262728293031323334
  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. Operator string
  22. EvalMatches []*EvalMatch
  23. }
  24. type Condition interface {
  25. Eval(result *EvalContext) (*ConditionResult, error)
  26. GetDatsourceId() (datasourceId *int64, exist bool)
  27. }