base.go 550 B

12345678910111213141516171819202122232425262728
  1. package notifiers
  2. import (
  3. "github.com/grafana/grafana/pkg/components/simplejson"
  4. "github.com/grafana/grafana/pkg/services/alerting"
  5. )
  6. type NotifierBase struct {
  7. Name string
  8. Type string
  9. }
  10. func NewNotifierBase(name, notifierType string, model *simplejson.Json) NotifierBase {
  11. base := NotifierBase{Name: name, Type: notifierType}
  12. return base
  13. }
  14. func (n *NotifierBase) PassesFilter(rule *alerting.Rule) bool {
  15. return true
  16. }
  17. func (n *NotifierBase) GetType() string {
  18. return n.Type
  19. }
  20. func (n *NotifierBase) NeedsImage() bool {
  21. return true
  22. }