improve: 优化 DDNS 配置读取形式

This commit is contained in:
Mmx233
2022-12-09 19:20:32 +08:00
parent 33283c66c9
commit 388ee21f64
3 changed files with 30 additions and 30 deletions

View File

@@ -29,12 +29,20 @@ type Log struct {
FileName string `json:"log_name" yaml:"log_name" mapstructure:"log_name"`
}
type DDNS struct {
Enable bool `json:"enable" yaml:"enable" mapstructure:"enable"`
TTL uint `json:"ttl" yaml:"ttl" mapstructure:"ttl"`
Domain string `json:"domain" yaml:"domain" mapstructure:"domain"`
Provider string `json:"provider" yaml:"provider" mapstructure:"provider"`
Config map[string]interface{} `mapstructure:",remain"`
}
type Settings struct {
Basic Basic `json:"basic" yaml:"basic" mapstructure:"basic"`
Guardian Guardian `json:"guardian" yaml:"guardian" mapstructure:"guardian"`
Daemon Daemon `json:"daemon" yaml:"daemon" mapstructure:"daemon"`
Log Log `json:"log" yaml:"log" mapstructure:"log"`
DDNS map[string]interface{} `json:"ddns" yaml:"ddns" mapstructure:"ddns"`
Basic Basic `json:"basic" yaml:"basic" mapstructure:"basic"`
Guardian Guardian `json:"guardian" yaml:"guardian" mapstructure:"guardian"`
Daemon Daemon `json:"daemon" yaml:"daemon" mapstructure:"daemon"`
Log Log `json:"log" yaml:"log" mapstructure:"log"`
DDNS DDNS `json:"ddns" yaml:"ddns" mapstructure:"ddns"`
}
type Config struct {