Documentation ¶
Index ¶
- Constants
- Variables
- func CheckSettings(config *Settings) error
- func GetCurrentIP(configuration *Settings) (string, error)
- func GetIPFromInterface(configuration *Settings) (string, error)
- func GetIPOnline(configuration *Settings) (string, error)
- func LoadSettings(configPath string, settings *Settings) error
- func SendNotify(configuration *Settings, domain, currentIP string) error
- type Domain
- type Notify
- type Settings
Constants ¶
View Source
const ( // PanicMax is the max allowed panic times PanicMax = 5 // INTERVAL is minute INTERVAL = 5 // DNSPOD for dnspod.cn DNSPOD = "DNSPod" // HE for he.net HE = "HE" // CLOUDFLARE for cloudflare.com CLOUDFLARE = "Cloudflare" )
Variables ¶
View Source
var ( // Logo for GoDNS Logo = `` /* 775-byte string literal not displayed */ )
Functions ¶
func CheckSettings ¶
CheckSettings check the format of settings
func GetCurrentIP ¶
GetCurrentIP gets an IP from either internet or specific interface, depending on configuration
func GetIPFromInterface ¶
GetIPFromInterface gets IP address from the specific interface
func GetIPOnline ¶
GetIPOnline gets public IP from internet
func LoadSettings ¶
LoadSettings -- Load settings from config file
func SendNotify ¶
SendNotify sends mail notify if IP is changed
Types ¶
type Domain ¶
type Domain struct { DomainName string `json:"domain_name"` SubDomains []string `json:"sub_domains"` }
Domain struct
type Notify ¶
type Notify struct { Enabled bool `json:"enabled"` SMTPServer string `json:"smtp_server"` SMTPUsername string `json:"smtp_username"` SMTPPassword string `json:"smtp_password"` SMTPPort int `json:"smtp_port"` SendTo string `json:"send_to"` }
Notify struct for SMTP notification
type Settings ¶
type Settings struct { Provider string `json:"provider"` Email string `json:"email"` Password string `json:"password"` LoginToken string `json:"login_token"` Domains []Domain `json:"domains"` IPUrl string `json:"ip_url"` LogPath string `json:"log_path"` Socks5Proxy string `json:"socks5_proxy"` Notify Notify `json:"notify"` IPInterface string `json:"ip_interface"` }
Settings struct
Click to show internal directories.
Click to hide internal directories.