mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-25 00:10:26 +08:00
修复开源版本无法编译的问题
This commit is contained in:
@@ -3,7 +3,6 @@ package models
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/remotelogs"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/dnsconfigs"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/ddosconfigs"
|
||||
)
|
||||
|
||||
@@ -29,47 +28,3 @@ func (this *NSCluster) HasDDoSProtection() bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// DecodeHosts 解析主机地址
|
||||
func (this *NSCluster) DecodeHosts() []string {
|
||||
if IsNull(this.Hosts) {
|
||||
return nil
|
||||
}
|
||||
|
||||
var hosts = []string{}
|
||||
err := json.Unmarshal(this.Hosts, &hosts)
|
||||
if err != nil {
|
||||
remotelogs.Error("NSCluster.DecodeHosts", "decode failed: "+err.Error())
|
||||
}
|
||||
|
||||
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()
|
||||
|
||||
if IsNull(this.Answer) {
|
||||
return config
|
||||
}
|
||||
|
||||
err := json.Unmarshal(this.Answer, config)
|
||||
if err != nil {
|
||||
remotelogs.Error("NSCluster.DecodeAnswerConfig", "decode failed: "+err.Error())
|
||||
}
|
||||
|
||||
return config
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user