Documentation ¶
Index ¶
Constants ¶
View Source
const (
// IntervalMinValue is the lowest possible value between two updates (in sec)
IntervalMinValue = 60
)
Variables ¶
View Source
var ( // DefaultIPv4Config is the default configuration for IPv4 DefaultIPv4Config = IPConfig{ URL: "https://api.ipify.org", Enabled: true, } // DefaultIPv6Config is the default configuration for IPv6 DefaultIPv6Config = IPConfig{ URL: "https://api6.ipify.org", Enabled: false, } // DefaultScalewayConfig is the default configuration to use the Scaleway API DefaultScalewayConfig = ScalewayConfig{} // DefaultDomainConfig is the default domain configuration for common parameters DefaultDomainConfig = DomainConfig{ Record: "ddns", TTL: 60, } // DefaultTelegramConfig is the default configuration to use Telegram notifications DefaultTelegramConfig = TelegramConfig{ Enabled: false, Template: "DNS record *{{ .RecordName }}.{{ .Domain }}* has been updated from *{{ .PreviousIP }}* to *{{ .NewIP }}*", } // DefaultConfig is the global default configuration. DefaultConfig = Config{ Interval: 300, DomainConfig: DefaultDomainConfig, IPv4Config: DefaultIPv4Config, IPv6Config: DefaultIPv6Config, ScalewayConfig: DefaultScalewayConfig, TelegramConfig: DefaultTelegramConfig, } )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Interval uint `yaml:"interval"` IPv4Config IPConfig `yaml:"ipv4"` IPv6Config IPConfig `yaml:"ipv6"` ScalewayConfig ScalewayConfig `yaml:"scaleway"` DomainConfig DomainConfig `yaml:"domain"` TelegramConfig TelegramConfig `yaml:"telegram"` }
Config struct for the configuration file
type Container ¶ added in v0.1.0
type Container struct { Logger *logrus.Logger Config *Config DNS *scaleway.DNS Notifiers []Notifier }
Container structure to hold global objects
func NewContainer ¶ added in v0.1.0
NewContainer returns a new container instance
func (*Container) AddNotifier ¶ added in v0.1.0
AddNotifier adds a new notifier into the container
type DomainConfig ¶
type DomainConfig struct { Name string `yaml:"name"` Record string `yaml:"record"` TTL uint32 `yaml:"ttl"` }
DomainConfig struct for the domain parameters
type Notifier ¶ added in v0.1.0
type Notifier interface {
Notify(domain string, recordName string, recordType string, previousIP string, newIP string) error
}
Notifier interface to represent any notifier
type ScalewayConfig ¶
type ScalewayConfig struct { ProjectID string `yaml:"project_id"` AccessKey string `yaml:"access_key"` SecretKey string `yaml:"secret_key"` }
ScalewayConfig struct for the required configuration to use the Scaleway API
Click to show internal directories.
Click to hide internal directories.