mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-15 00:40:26 +08:00
实现基本的集群DNS列表、设置、简单数据同步
This commit is contained in:
@@ -39,3 +39,17 @@ func (this *Node) DecodeStatus() (*nodeconfigs.NodeStatus, error) {
|
||||
}
|
||||
return status, nil
|
||||
}
|
||||
|
||||
// DNS线路
|
||||
func (this *Node) DNSRoute(dnsDomainId int64) (string, error) {
|
||||
routes := map[int64]string{} // domainId => route
|
||||
if len(this.DnsRoutes) == 0 || this.DnsRoutes == "null" {
|
||||
return "", nil
|
||||
}
|
||||
err := json.Unmarshal([]byte(this.DnsRoutes), &routes)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
route, _ := routes[dnsDomainId]
|
||||
return route, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user