feat: notification provider (#8)
All checks were successful
CD / test (push) Successful in 48s
CD / Build and push (push) Successful in 3m48s

Co-authored-by: Timo Behrendt <t.behrendt@t00n.de>
Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
This commit was merged in pull request #8.
This commit is contained in:
2024-08-11 11:52:51 +02:00
committed by t.behrendt
parent b8bdcaa35e
commit 7bb1e9ca08
11 changed files with 304 additions and 31 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 {