MCPcopy
hub / github.com/docker/compose / AddVertex

Method AddVertex

pkg/compose/dependencies.go:300–306  ·  view source on GitHub ↗

AddVertex adds a vertex to the Graph

(key string, service string, initialStatus ServiceStatus)

Source from the content-addressed store, hash-verified

298
299// AddVertex adds a vertex to the Graph
300func (g *Graph) AddVertex(key string, service string, initialStatus ServiceStatus) {
301 g.lock.Lock()
302 defer g.lock.Unlock()
303
304 v := NewVertex(key, service, initialStatus)
305 g.Vertices[key] = v
306}
307
308// AddEdge adds a relationship of dependency between vertices `source` and `destination`
309func (g *Graph) AddEdge(source string, destination string) error {

Callers 2

TestWith_RootNodesAndUpFunction · 0.95
NewGraphFunction · 0.95

Calls 2

NewVertexFunction · 0.85
LockMethod · 0.45

Tested by 1

TestWith_RootNodesAndUpFunction · 0.76