InDependencyOrder applies the function to the services of the project taking in account the dependency order
(ctx context.Context, project *types.Project, fn func(context.Context, string) error, options ...func(*graphTraversal))
| 77 | |
| 78 | // InDependencyOrder applies the function to the services of the project taking in account the dependency order |
| 79 | func InDependencyOrder(ctx context.Context, project *types.Project, fn func(context.Context, string) error, options ...func(*graphTraversal)) error { |
| 80 | graph, err := NewGraph(project, ServiceStopped) |
| 81 | if err != nil { |
| 82 | return err |
| 83 | } |
| 84 | t := upDirectionTraversal(fn) |
| 85 | for _, option := range options { |
| 86 | option(t) |
| 87 | } |
| 88 | return t.visit(ctx, graph) |
| 89 | } |
| 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 { |