feat: add notification provider

This commit is contained in:
2024-08-11 10:11:25 +02:00
parent b8bdcaa35e
commit 12898535e6
7 changed files with 91 additions and 28 deletions

View File

@@ -12,10 +12,11 @@ type DomainConfig struct {
}
type Config struct {
ExternalIPProvider ExternalIpProviderConfig `yaml:"ip_provider"`
DNSProvider DNSProviderConfig `yaml:"dns_provider"`
Domains []DomainConfig `yaml:"domains"`
CheckInterval string `yaml:"check_interval"`
ExternalIPProvider ExternalIpProviderConfig `yaml:"ip_provider"`
DNSProvider DNSProviderConfig `yaml:"dns_provider"`
NotificationProvider NotificationProviderConfig `yaml:"notification_provider,omitempty"`
Domains []DomainConfig `yaml:"domains"`
CheckInterval string `yaml:"check_interval"`
}
type ExternalIpProviderConfig struct {
@@ -28,6 +29,11 @@ type DNSProviderConfig struct {
ProviderConfig yaml.Node `yaml:"config"`
}
type NotificationProviderConfig struct {
Type string `yaml:"type"`
ProviderConfig yaml.Node `yaml:"config"`
}
func (c *Config) Load(filePath string) error {
err := yaml.Unmarshal([]byte(filePath), c)
if err != nil {