(shardIndex int, addr, role, password string)
| 118 | } |
| 119 | |
| 120 | func (cluster *Cluster) AddNode(shardIndex int, addr, role, password string) (*ClusterNode, error) { |
| 121 | if shardIndex < 0 || shardIndex >= len(cluster.Shards) { |
| 122 | return nil, consts.ErrIndexOutOfRange |
| 123 | } |
| 124 | return cluster.Shards[shardIndex].addNode(addr, role, password) |
| 125 | } |
| 126 | |
| 127 | func (cluster *Cluster) RemoveNode(shardIndex int, nodeID string) error { |
| 128 | if shardIndex < 0 || shardIndex >= len(cluster.Shards) { |