build: remove dependency of mapstructre

This commit is contained in:
Mmx233
2024-03-23 19:49:11 +08:00
parent dbf46c715b
commit cac851d751
10 changed files with 68 additions and 74 deletions

View File

@@ -16,17 +16,15 @@ func Run(c *Config) error {
c.TTL = 600
}
// 配置解析
var dns Provider
var err error
switch c.Provider {
case "aliyun":
dns, err = aliyun.New(c.TTL, c.Conf, c.Http)
dns, err = aliyun.New(c.TTL, c.Conf.Aliyun, c.Http)
case "cloudflare":
dns, err = cloudflare.New(int(c.TTL), c.Conf, c.Http)
dns, err = cloudflare.New(int(c.TTL), c.Conf.Cloudflare, c.Http)
case "dnspod":
dns, err = dnspod.New(uint64(c.TTL), c.Conf, c.Http.Transport)
dns, err = dnspod.New(uint64(c.TTL), c.Conf.DnsPod, c.Http.Transport)
default:
var msg string
if c.Provider == "" {