mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-28 08:26:36 +08:00
域名解析增加CloudFlare DNS支持
This commit is contained in:
@@ -9,10 +9,11 @@ const (
|
||||
ProviderTypeDNSPod ProviderType = "dnspod"
|
||||
ProviderTypeAliDNS ProviderType = "alidns"
|
||||
ProviderTypeDNSCom ProviderType = "dnscom"
|
||||
ProviderTypeCloudFlare ProviderType = "cloudFlare"
|
||||
ProviderTypeCustomHTTP ProviderType = "customHTTP"
|
||||
)
|
||||
|
||||
// 所有的服务商类型
|
||||
// AllProviderTypes 所有的服务商类型
|
||||
var AllProviderTypes = []maps.Map{
|
||||
{
|
||||
"name": "阿里云DNS",
|
||||
@@ -26,26 +27,32 @@ var AllProviderTypes = []maps.Map{
|
||||
"name": "帝恩思DNS.COM",
|
||||
"code": ProviderTypeDNSCom,
|
||||
},**/
|
||||
{
|
||||
"name": "CloudFlare DNS",
|
||||
"code": ProviderTypeCloudFlare,
|
||||
},
|
||||
{
|
||||
"name": "自定义HTTP DNS",
|
||||
"code": ProviderTypeCustomHTTP,
|
||||
},
|
||||
}
|
||||
|
||||
// 查找服务商实例
|
||||
// FindProvider 查找服务商实例
|
||||
func FindProvider(providerType ProviderType) ProviderInterface {
|
||||
switch providerType {
|
||||
case ProviderTypeDNSPod:
|
||||
return &DNSPodProvider{}
|
||||
case ProviderTypeAliDNS:
|
||||
return &AliDNSProvider{}
|
||||
case ProviderTypeCloudFlare:
|
||||
return &CloudFlareProvider{}
|
||||
case ProviderTypeCustomHTTP:
|
||||
return &CustomHTTPProvider{}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 查找服务商名称
|
||||
// FindProviderTypeName 查找服务商名称
|
||||
func FindProviderTypeName(providerType ProviderType) string {
|
||||
for _, t := range AllProviderTypes {
|
||||
if t.GetString("code") == providerType {
|
||||
|
||||
Reference in New Issue
Block a user