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))
| 90 | |
| 91 | // InReverseDependencyOrder applies the function to the services of the project in reverse order of dependencies |
| 92 | func 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 | |
| 104 | func WithRootNodesAndDown(nodes []string) func(*graphTraversal) { |
| 105 | return func(t *graphTraversal) { |