2020-11-02 15:06:26 +01:00
|
|
|
package alert
|
|
|
|
|
2020-11-17 17:10:59 +01:00
|
|
|
import log "github.com/sirupsen/logrus"
|
|
|
|
|
|
|
|
var logPackage = log.WithField("package", "alert")
|
|
|
|
|
2020-11-05 13:43:41 +01:00
|
|
|
// Notifier to send notifications to an endpoint
|
|
|
|
type Notifier interface {
|
|
|
|
Notify(Data) error
|
2020-11-02 15:06:26 +01:00
|
|
|
}
|
|
|
|
|
2020-11-05 13:43:41 +01:00
|
|
|
// Data hold the information to send a new notification
|
2020-11-02 15:06:26 +01:00
|
|
|
type Data struct {
|
2020-11-05 14:21:21 +01:00
|
|
|
Title string `json:"title"`
|
|
|
|
Message string `json:"message"`
|
|
|
|
Priority int `json:"priority"`
|
2020-11-02 15:06:26 +01:00
|
|
|
}
|