feat: notification provider gotify
This commit is contained in:
15
main.go
15
main.go
@@ -2,6 +2,8 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"realdnydns/pkg/changeDetector"
|
||||
"realdnydns/pkg/config"
|
||||
"realdnydns/pkg/dnsProvider"
|
||||
@@ -10,7 +12,7 @@ import (
|
||||
plainExternalIpProvider "realdnydns/pkg/externalIpProvider/plain"
|
||||
"realdnydns/pkg/notificationProvider"
|
||||
notificationProviderConsole "realdnydns/pkg/notificationProvider/console"
|
||||
"time"
|
||||
gotify "realdnydns/pkg/notificationProvider/gotify"
|
||||
|
||||
"github.com/go-co-op/gocron"
|
||||
)
|
||||
@@ -54,6 +56,17 @@ func main() {
|
||||
|
||||
var notificationProvider notificationProvider.NotificationProvider
|
||||
switch configClient.NotificationProvider.Type {
|
||||
case "gotify":
|
||||
var gotifyConfig gotify.NotificationProviderImplGotifyConfig
|
||||
err := configClient.NotificationProvider.ProviderConfig.Decode(&gotifyConfig)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
notificationProvider, err = gotify.New(gotifyConfig)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
default:
|
||||
// Use default console notification provider
|
||||
notificationProvider = notificationProviderConsole.New()
|
||||
|
||||
Reference in New Issue
Block a user