(addr, password string)
| 96 | } |
| 97 | |
| 98 | func NewClusterNode(addr, password string) *ClusterNode { |
| 99 | return &ClusterNode{ |
| 100 | id: util.GenerateNodeID(), |
| 101 | addr: addr, |
| 102 | password: password, |
| 103 | role: RoleMaster, |
| 104 | createdAt: time.Now().Unix(), |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | func (n *ClusterNode) ID() string { |
| 109 | return n.id |