mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-10 20:40:56 +08:00
优化智能DNS相关代码
This commit is contained in:
@@ -45,6 +45,19 @@ func (this *NSCluster) DecodeHosts() []string {
|
||||
return hosts
|
||||
}
|
||||
|
||||
// DecodeSOAConfig 解析SOA设置
|
||||
func (this *NSCluster) DecodeSOAConfig() *dnsconfigs.NSSOAConfig {
|
||||
var config = dnsconfigs.DefaultNSSOAConfig()
|
||||
if IsNull(this.Soa) {
|
||||
return config
|
||||
}
|
||||
err := json.Unmarshal(this.Soa, config)
|
||||
if err != nil {
|
||||
remotelogs.Error("NSCluster.DecodeSOAConfig", "decode failed: "+err.Error())
|
||||
}
|
||||
return config
|
||||
}
|
||||
|
||||
// DecodeAnswerConfig 解析应答设置
|
||||
func (this *NSCluster) DecodeAnswerConfig() *dnsconfigs.NSAnswerConfig {
|
||||
var config = dnsconfigs.DefaultNSAnswerConfig()
|
||||
|
||||
Reference in New Issue
Block a user