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

Function InReverseDependencyOrder

pkg/compose/dependencies.go:92–102  ·  view source on GitHub ↗

InReverseDependencyOrder applies the function to the services of the project in reverse order of dependencies

(ctx context.Context, project *types.Project, fn func(context.Context, string) error, options ...func(*graphTraversal))

Source from the content-addressed store, hash-verified

90
91// InReverseDependencyOrder applies the function to the services of the project in reverse order of dependencies
92func InReverseDependencyOrder(ctx context.Context, project *types.Project, fn func(context.Context, string) error, options ...func(*graphTraversal)) error {
93 graph, err := NewGraph(project, ServiceStarted)
94 if err != nil {
95 return err
96 }
97 t := downDirectionTraversal(fn)
98 for _, option := range options {
99 option(t)
100 }
101 return t.visit(ctx, graph)
102}
103
104func WithRootNodesAndDown(nodes []string) func(*graphTraversal) {
105 return func(t *graphTraversal) {

Callers 3

stopMethod · 0.85
downMethod · 0.85

Calls 3

NewGraphFunction · 0.85
downDirectionTraversalFunction · 0.85
visitMethod · 0.45

Tested by 1