-
Notifications
You must be signed in to change notification settings - Fork 34
/
base.go
42 lines (34 loc) · 786 Bytes
/
base.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package notifiers
import (
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/services/alerting"
)
type NotifierBase struct {
Name string
Type string
Id int64
IsDeault bool
}
func NewNotifierBase(id int64, isDefault bool, name, notifierType string, model *simplejson.Json) NotifierBase {
return NotifierBase{
Id: id,
Name: name,
IsDeault: isDefault,
Type: notifierType,
}
}
func (n *NotifierBase) PassesFilter(rule *alerting.Rule) bool {
return true
}
func (n *NotifierBase) GetType() string {
return n.Type
}
func (n *NotifierBase) NeedsImage() bool {
return true
}
func (n *NotifierBase) GetNotifierId() int64 {
return n.Id
}
func (n *NotifierBase) GetIsDefault() bool {
return n.IsDeault
}