集群设置中增加服务设置

This commit is contained in:
GoEdgeLab
2022-09-16 18:42:14 +08:00
parent 63573b00f8
commit 3bd95d55ff
9 changed files with 215 additions and 9 deletions

View File

@@ -5,6 +5,7 @@ import (
"github.com/TeaOSLab/EdgeAPI/internal/remotelogs"
"github.com/TeaOSLab/EdgeCommon/pkg/dnsconfigs"
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/ddosconfigs"
)
@@ -64,3 +65,15 @@ func (this *NodeCluster) DecodeClock() *nodeconfigs.ClockConfig {
}
return clock
}
// DecodeGlobalServerConfig 解析全局服务配置
func (this *NodeCluster) DecodeGlobalServerConfig() *serverconfigs.GlobalServerConfig {
var config = serverconfigs.DefaultGlobalServerConfig()
if IsNotNull(this.GlobalServerConfig) {
err := json.Unmarshal(this.GlobalServerConfig, config)
if err != nil {
remotelogs.Error("NodeCluster.DecodeGlobalServerConfig()", err.Error())
}
}
return config
}