NewNode returns a new Node instance
(id string)
| 16 | |
| 17 | // NewNode returns a new Node instance |
| 18 | func NewNode(id string) *Node { |
| 19 | return &Node{ |
| 20 | id: id, |
| 21 | neighbors: make([]*Node, 0), |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | // AddNeighbor adds a neighbor to the node |
| 26 | func (n *Node) AddNeighbor(neighbor *Node) { |