NewNode creates a new node
(id, name, ipAddress string, port int)
| 29 | |
| 30 | // NewNode creates a new node |
| 31 | func NewNode(id, name, ipAddress string, port int) *Node { |
| 32 | return &Node{ |
| 33 | ID: id, |
| 34 | Name: name, |
| 35 | IPAddress: ipAddress, |
| 36 | Port: port, |
| 37 | CreatedAt: time.Now(), |
| 38 | UpdatedAt: time.Now(), |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | // GetID returns the node's ID |
| 43 | func (n *Node) GetID() string { |
no outgoing calls