feat: 重构配置层,添加 json 支持

This commit is contained in:
Mmx233
2023-08-28 22:03:03 +08:00
parent 2a098e00dd
commit 6f283a93f5
19 changed files with 318 additions and 272 deletions

View File

@@ -0,0 +1,39 @@
package config
import (
"github.com/Mmx233/BitSrunLoginGo/pkg/srun"
)
var defaultConfig = ConfFromFile{
Form: srun.LoginForm{
Domain: "www.msftconnecttest.com",
UserType: "cmcc",
},
Meta: srun.LoginMeta{
N: "200",
Type: "1",
Acid: "5",
Enc: "srun_bx1",
},
Settings: SettingsConf{
Basic: BasicConf{
Timeout: 5,
},
Guardian: GuardianConf{
Duration: 300,
},
Log: LogConf{
FilePath: "./",
},
DDNS: DdnsConf{
Enable: false,
TTL: 600,
Domain: "www.example.com",
Provider: "cloudflare",
Config: map[string]interface{}{
"zone": "",
"token": "",
},
},
},
}