improve: 移除 yaml config 之外类型的支持

This commit is contained in:
Mmx233
2023-08-28 20:49:36 +08:00
parent 266590f154
commit 2a098e00dd
7 changed files with 80 additions and 533 deletions

View File

@@ -7,7 +7,7 @@ import (
"encoding/json"
"errors"
"fmt"
dnsUtil2 "github.com/Mmx233/BitSrunLoginGo/internal/pkg/dns/util"
dnsUtil "github.com/Mmx233/BitSrunLoginGo/internal/pkg/dns/util"
"github.com/Mmx233/tool"
"math/rand"
"net/http"
@@ -28,7 +28,7 @@ func New(ttl uint, conf map[string]interface{}, Http *http.Client) (*DnsProvider
TTL: ttl,
Http: tool.NewHttpTool(Http),
}
e := dnsUtil2.DecodeConfig(conf, &p)
e := dnsUtil.DecodeConfig(conf, &p)
if e != nil {
return nil, e
}
@@ -162,7 +162,7 @@ func (a DnsProvider) NewRecord(subDomain, rootDomain, ip string) error {
}
func (a DnsProvider) SetDomainRecord(domain, ip string) error {
subDomain, rootDomain, e := dnsUtil2.DecodeDomain(domain)
subDomain, rootDomain, e := dnsUtil.DecodeDomain(domain)
if e != nil {
return e
}