MCPcopy
hub / github.com/jeessy2/ddns-go / Init

Method Init

dns/rainyun.go:48–61  ·  view source on GitHub ↗

Init 初始化

(dnsConf *config.DnsConfig, ipv4cache *util.IpCache, ipv6cache *util.IpCache)

Source from the content-addressed store, hash-verified

46
47// Init 初始化
48func (rainyun *Rainyun) Init(dnsConf *config.DnsConfig, ipv4cache *util.IpCache, ipv6cache *util.IpCache) {
49 rainyun.Domains.Ipv4Cache = ipv4cache
50 rainyun.Domains.Ipv6Cache = ipv6cache
51 rainyun.DNS = dnsConf.DNS
52 rainyun.Domains.GetNewIp(dnsConf)
53 if dnsConf.TTL == "" {
54 // 默认600s
55 rainyun.TTL = 600
56 } else {
57 ttlInt, _ := strconv.Atoi(dnsConf.TTL)
58 rainyun.TTL = ttlInt
59 }
60 rainyun.httpClient = dnsConf.GetHTTPClient()
61}
62
63// AddUpdateDomainRecords 添加或更新IPv4/IPv6记录
64func (rainyun *Rainyun) AddUpdateDomainRecords() (domains config.Domains) {

Callers

nothing calls this directly

Calls 2

GetNewIpMethod · 0.80
GetHTTPClientMethod · 0.80

Tested by

no test coverage detected