支持自定义HTTP DNS

This commit is contained in:
刘祥超
2021-01-28 11:29:57 +08:00
parent aeb16faa4f
commit fdb6b1a6bc
3 changed files with 225 additions and 3 deletions

View File

@@ -6,9 +6,10 @@ type ProviderType = string
// 服务商代号
const (
ProviderTypeDNSPod ProviderType = "dnspod"
ProviderTypeAliDNS ProviderType = "alidns"
ProviderTypeDNSCom ProviderType = "dnscom"
ProviderTypeDNSPod ProviderType = "dnspod"
ProviderTypeAliDNS ProviderType = "alidns"
ProviderTypeDNSCom ProviderType = "dnscom"
ProviderTypeCustomHTTP ProviderType = "customHTTP"
)
// 所有的服务商类型
@@ -25,6 +26,10 @@ var AllProviderTypes = []maps.Map{
"name": "帝恩思DNS.COM",
"code": ProviderTypeDNSCom,
},**/
{
"name": "自定义HTTP DNS",
"code": ProviderTypeCustomHTTP,
},
}
// 查找服务商实例
@@ -34,6 +39,8 @@ func FindProvider(providerType ProviderType) ProviderInterface {
return &DNSPodProvider{}
case ProviderTypeAliDNS:
return &AliDNSProvider{}
case ProviderTypeCustomHTTP:
return &CustomHTTPProvider{}
}
return nil
}