Documentation
¶
Index ¶
- Constants
- Variables
- func CheckIPv4Format(ip string) error
- func GetConfigFilePath() (string, error)
- func GetIPv4() (string, error)
- func GetIPv4ByUrl(url string) (string, error)
- func SendEmail(subject string, content string) error
- func SendIPChangeEmail(newIP string, oldIP string) error
- func SendStartupEmail(newIP string) error
- func UpdateCloudflareRecord(req *http.Request) error
- func UpdateCloudflareRecords(ip string) error
- func UpdateDNSPodRecord(values url.Values) error
- func UpdateDNSPodRecords(ip string) error
- type DnsRecord
- type ICloudflareConfig
- type IConfig
- type IDDNSConfig
- type IDNSPodConfig
- type IEmailConfig
- type IIPConfig
- type ILogger
Constants ¶
View Source
const DNSPodAPIUrl = "https://dnsapi.cn/Record.Modify"
Variables ¶
View Source
var Logger = ILogger{}
Functions ¶
func CheckIPv4Format ¶ added in v0.1.2
func GetConfigFilePath ¶
func GetIPv4ByUrl ¶
func SendIPChangeEmail ¶ added in v0.1.2
func SendStartupEmail ¶ added in v0.1.2
func UpdateCloudflareRecord ¶ added in v0.1.4
func UpdateCloudflareRecords ¶ added in v0.1.4
func UpdateDNSPodRecord ¶ added in v0.1.3
func UpdateDNSPodRecords ¶ added in v0.1.3
Types ¶
type ICloudflareConfig ¶ added in v0.1.4
type ICloudflareConfig struct {
Enabled bool `yaml:"enabled"`
APIToken string `yaml:"api_token"`
Records []struct {
ZoneId string `yaml:"zone_id"`
RecordId string `yaml:"record_id"`
RecordName string `yaml:"record_name"`
RecordType string `yaml:"record_type"`
TTL int `yaml:"ttl"`
Proxied bool `yaml:"proxied"`
} `yaml:"records"`
}
type IConfig ¶
type IConfig struct {
Ip IIPConfig `yaml:"ip"`
Email IEmailConfig `yaml:"email"`
DDNS IDDNSConfig `yaml:"DDNS"`
}
type IDDNSConfig ¶ added in v0.1.3
type IDDNSConfig struct {
DNSPod IDNSPodConfig `yaml:"DNSPod"`
Cloudflare ICloudflareConfig `yaml:"Cloudflare"`
}
type IDNSPodConfig ¶ added in v0.1.3
type IDNSPodConfig struct {
Enabled bool `yaml:"enabled"`
LoginToken string `yaml:"login_token"`
Records []struct {
DomainId string `yaml:"domain_id"`
RecordId string `yaml:"record_id"`
SubDomain string `yaml:"sub_domain"`
RecordType string `yaml:"record_type"`
RecordLine string `yaml:"record_line"`
TTL int
} `yaml:"records"`
}
type IEmailConfig ¶
Click to show internal directories.
Click to hide internal directories.