MCPcopy Index your code
hub / github.com/google/seesaw / thisNode

Method thisNode

engine/core.go:219–235  ·  view source on GitHub ↗

thisNode returns the Node for the machine on which this engine is running.

()

Source from the content-addressed store, hash-verified

217
218// thisNode returns the Node for the machine on which this engine is running.
219func (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.
238func (e *Engine) engineIPC() {

Callers 2

haConfigMethod · 0.95
managerMethod · 0.95

Implementers 3

EngineClientha/engine_client.go
DummyEngineha/engine_client.go
SeesawEngineengine/ipc.go

Calls 1

EqualMethod · 0.45

Tested by

no test coverage detected