thisNode returns the Node for the machine on which this engine is running.
()
| 217 | |
| 218 | // thisNode returns the Node for the machine on which this engine is running. |
| 219 | func (e *Engine) thisNode() (*seesaw.Node, error) { |
| 220 | e.clusterLock.RLock() |
| 221 | c := e.cluster |
| 222 | e.clusterLock.RUnlock() |
| 223 | |
| 224 | if c == nil { |
| 225 | return nil, fmt.Errorf("cluster configuration not loaded") |
| 226 | } |
| 227 | // TODO(jsing): This does not allow for IPv6-only operation. |
| 228 | ip := e.config.Node.IPv4Addr |
| 229 | for _, n := range c.Nodes { |
| 230 | if ip.Equal(n.IPv4Addr) { |
| 231 | return n, nil |
| 232 | } |
| 233 | } |
| 234 | return nil, fmt.Errorf("node %v not configured", ip) |
| 235 | } |
| 236 | |
| 237 | // engineIPC starts an RPC server to handle IPC via a Unix Domain socket. |
| 238 | func (e *Engine) engineIPC() { |
no test coverage detected