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

Method Init

dns/huawei.go:55–72  ·  view source on GitHub ↗

Init 初始化

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

Source from the content-addressed store, hash-verified

53
54// Init 初始化
55func (hw *Huaweicloud) Init(dnsConf *config.DnsConfig, ipv4cache *util.IpCache, ipv6cache *util.IpCache) {
56 hw.Domains.Ipv4Cache = ipv4cache
57 hw.Domains.Ipv6Cache = ipv6cache
58 hw.DNS = dnsConf.DNS
59 hw.Domains.GetNewIp(dnsConf)
60 if dnsConf.TTL == "" {
61 // 默认300s
62 hw.TTL = 300
63 } else {
64 ttl, err := strconv.Atoi(dnsConf.TTL)
65 if err != nil {
66 hw.TTL = 300
67 } else {
68 hw.TTL = ttl
69 }
70 }
71 hw.httpClient = dnsConf.GetHTTPClient()
72}
73
74// AddUpdateDomainRecords 添加或更新IPv4/IPv6记录
75func (hw *Huaweicloud) AddUpdateDomainRecords() config.Domains {

Callers

nothing calls this directly

Calls 2

GetNewIpMethod · 0.80
GetHTTPClientMethod · 0.80

Tested by

no test coverage detected