mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-04-24 22:05:18 +08:00
启动的时候尝试从备份文件中恢复配置
This commit is contained in:
@@ -12,3 +12,18 @@ func TestLoadAPIConfig(t *testing.T) {
|
||||
}
|
||||
t.Log(config)
|
||||
}
|
||||
|
||||
func TestAPIConfig_WriteFile(t *testing.T) {
|
||||
config := &APIConfig{
|
||||
RPC: struct {
|
||||
Endpoints []string `yaml:"endpoints"`
|
||||
}{},
|
||||
NodeId: "1",
|
||||
Secret: "2",
|
||||
}
|
||||
err := config.WriteFile("/tmp/api_config.yaml")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log("ok")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user