新增全局配置

This commit is contained in:
orgin
2022-04-02 14:02:33 +08:00
parent 63199bf862
commit 68b891df51
2 changed files with 80 additions and 71 deletions

View File

@@ -41,8 +41,9 @@ type NodeRpcInfo struct {
var cluster Cluster
type Cluster struct {
localNodeInfo NodeInfo //本结点配置信息
masterDiscoveryNodeList []NodeInfo //配置发现Master结点
localNodeInfo NodeInfo //本结点配置信息
masterDiscoveryNodeList []NodeInfo //配置发现Master结点
globalCfg interface{} //全局配置
localServiceCfg map[string]interface{} //map[serviceName]配置数据*
mapRpc map[int]NodeRpcInfo //nodeId
@@ -418,3 +419,7 @@ func HasService(nodeId int, serviceName string) bool {
return false
}
func (cls *Cluster) GetGlobalCfg() interface{} {
return cls.globalCfg
}