Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { CfgFilePath string `json:"-"` Reloaded chan bool `json:"-"` // A channel upon which config reload events are delivered LastUpdateInterval string `json:"-"` // Used to track changes to the update interval FileInfo os.FileInfo `json:"-"` // Used to track changes to the config file Mu *sync.Mutex `json:"-"` // Used to lock and unlock access to the package level cfg UpdateInterval string `json:"updateInterval"` // A duration string parsed by time.ParseDuration ServerPort string `json:"serverPort"` // The port that the inbuilt http server listens on Hostname string `json:"hostname"` // The hostname of the machine where this code is running LastIPv4 net.IP `json:"lastIPv4"` LastIPv6 net.IP `json:"lastIPv6"` Router RouterConfiguration `json:"router,omitempty"` Services []ServiceConfiguration `json:"services,omitempty"` Notifications Notifications `json:"notifications,omitempty"` }
func Load ¶
func Load(cfgFilePath string) (*Configuration, *time.Ticker)
Load loads the serviceConfig.json file described by cfgFilePath and sets up a config file watcher to detect changes to enable config reload on change. Load also creates a new Time.Ticker with a tick duration set to the currently configured appData.UpdateInterval
func (*Configuration) GetDomainsStr ¶
func (appData *Configuration) GetDomainsStr() (string, error)
GetDomainsStr returns a comma separated string of all configured target domain names
func (*Configuration) IPAddressesChanged ¶
IPAddressesChanged returns an indicator that describes if either the supplied ipv4 or ipv6 have changed
type Email ¶
type Email struct { IsEnabled bool `json:"enabled"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` From EmailAddress Recipients []EmailAddress SmtpServer string `json:"smtpServer,omitempty"` SecurityType string `json:"securityType,omitempty"` /*SSL or TLS*/ }
type EmailAddress ¶
type Notifications ¶
type Notifications struct { SipgateSMS SipgateSMS `json:"sipgateSMS,omitempty"` Email Email `json:"email,omitempty"` }
type RouterConfiguration ¶
type ServiceConfiguration ¶
type ServiceConfiguration struct { ServiceType string `json:"serviceType"` TargetDomain string `json:"targetDomain"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` Token string `json:"token,omitempty"` EmailAddress string `json:"emailAddress,omitempty"` APIKey string `json:"apikey,omitempty"` APISecret string `json:"apisecret,omitempty"` RecordName string `json:"recordname,omitempty"` Port int `json:"port,omitempty"` TTL int `json:"ttl,omitempty"` }
Click to show internal directories.
Click to hide internal directories.