API RPC配置增加disableUpdate,可以停用自动更新API节点

This commit is contained in:
刘祥超
2022-07-21 14:06:38 +08:00
parent 515a590681
commit 2b650fd285
5 changed files with 32 additions and 18 deletions

View File

@@ -9,7 +9,8 @@ import (
// APIConfig 节点API配置
type APIConfig struct {
RPC struct {
Endpoints []string `yaml:"endpoints"`
Endpoints []string `yaml:"endpoints"`
DisableUpdate bool `yaml:"disableUpdate"`
} `yaml:"rpc"`
NodeId string `yaml:"nodeId"`
Secret string `yaml:"secret"`
@@ -30,7 +31,7 @@ func LoadAPIConfig() (*APIConfig, error) {
return config, nil
}
// 保存到文件
// WriteFile 保存到文件
func (this *APIConfig) WriteFile(path string) error {
data, err := yaml.Marshal(this)
if err != nil {