新增私有服务功能(结点中服务配置加前缀_)

This commit is contained in:
boyce
2020-11-04 10:56:11 +08:00
parent c7d900ace4
commit 2fc1217b18
5 changed files with 63 additions and 32 deletions

View File

@@ -146,6 +146,12 @@ func (cls *Cluster) parseLocalCfg(){
}
}
func (cls *Cluster) localPrivateService(localNodeInfo *NodeInfo){
for i:=0;i<len(localNodeInfo.ServiceList);i++{
localNodeInfo.ServiceList[i] = strings.TrimLeft(localNodeInfo.ServiceList[i],"_")
}
}
func (cls *Cluster) InitCfg(localNodeId int) error{
cls.localServiceCfg = map[string]interface{}{}
cls.mapRpc = map[int] NodeRpcInfo{}
@@ -158,6 +164,7 @@ func (cls *Cluster) InitCfg(localNodeId int) error{
return err
}
cls.localNodeInfo = nodeInfoList[0]
cls.localPrivateService(&cls.localNodeInfo)
//读取本地服务配置
err = cls.readLocalService(localNodeId)