Update updates the node's information
(name, ipAddress string, port int)
| 83 | |
| 84 | // Update updates the node's information |
| 85 | func (n *Node) Update(name, ipAddress string, port int) error { |
| 86 | n.mu.Lock() |
| 87 | defer n.mu.Unlock() |
| 88 | n.Name = name |
| 89 | n.IPAddress = ipAddress |
| 90 | n.Port = port |
| 91 | n.UpdatedAt = time.Now() |
| 92 | return nil |
| 93 | } |
| 94 | |
| 95 | // MarshalJSON marshals the node to JSON |
| 96 | func (n *Node) MarshalJSON() ([]byte, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected