MCPcopy
hub / github.com/eolinker/goku_lite / AddNode

Function AddNode

console/module/node/node.go:11–15  ·  view source on GitHub ↗

AddNode 新增节点信息

(clusterID int, nodeName, listenAddress, adminAddress, gatewayPath string, groupID int)

Source from the content-addressed store, hash-verified

9
10//AddNode 新增节点信息
11func AddNode(clusterID int, nodeName, listenAddress, adminAddress, gatewayPath string, groupID int) (int64, string, string, error) {
12 now := time.Now().Format("20060102150405")
13 nodeKey := utils.Md5(utils.GetRandomString(16) + now)
14 return nodeDao.AddNode(clusterID, nodeName, nodeKey, listenAddress, adminAddress, gatewayPath, groupID)
15}
16
17//EditNode 修改节点
18func EditNode(nodeName, listenAddress, adminAddress, gatewayPath string, nodeID, groupID int) (string, error) {

Callers 1

AddNodeFunction · 0.92

Calls 4

Md5Function · 0.92
GetRandomStringFunction · 0.92
AddNodeMethod · 0.65
FormatMethod · 0.45

Tested by

no test coverage detected