Add Gotify notification client (#36)

Co-authored-by: Paul Götzinger <paul70079@gmail.com>
This commit is contained in:
CrazyMax
2020-02-17 22:39:43 +01:00
committed by GitHub
parent fbf7202ea8
commit f8d88e3893
10 changed files with 153 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ package notif
import (
"github.com/crazy-max/diun/internal/model"
"github.com/crazy-max/diun/internal/notif/gotify"
"github.com/crazy-max/diun/internal/notif/mail"
"github.com/crazy-max/diun/internal/notif/notifier"
"github.com/crazy-max/diun/internal/notif/slack"
@@ -38,6 +39,9 @@ func New(config model.Notif, app model.App) (*Client, error) {
if config.Webhook.Enable {
c.notifiers = append(c.notifiers, webhook.New(config.Webhook, app))
}
if config.Gotify.Enable {
c.notifiers = append(c.notifiers, gotify.New(config.Gotify, app))
}
log.Debug().Msgf("%d notifier(s) created", len(c.notifiers))
return c, nil