package graph
import "github.com/compose-spec/compose-go/v2/graph"
Index ¶
- func CollectInDependencyOrder[T any](ctx context.Context, project *types.Project, fn CollectorFn[types.ServiceConfig, T], options ...func(*Options)) (map[string]T, error)
- func InDependencyOrder(ctx context.Context, project *types.Project, fn VisitorFn[types.ServiceConfig], options ...func(*Options)) error
- func InReverseOrder(o *Options)
- func WithMaxConcurrency(max int) func(*Options)
- func WithRootNodesAndDown(nodes []string) func(*Options)
- type CollectorFn
- type Options
- type VisitorFn
Functions ¶
func CollectInDependencyOrder ¶
func CollectInDependencyOrder[T any](ctx context.Context, project *types.Project, fn CollectorFn[types.ServiceConfig, T], options ...func(*Options)) (map[string]T, error)
CollectInDependencyOrder walk the service graph an invoke CollectorFn in respect to dependency order, then return result for each call
func InDependencyOrder ¶
func InDependencyOrder(ctx context.Context, project *types.Project, fn VisitorFn[types.ServiceConfig], options ...func(*Options)) error
InDependencyOrder walk the service graph an invoke VisitorFn in respect to dependency order
func InReverseOrder ¶
func InReverseOrder(o *Options)
InReverseOrder configure traversal to walk the graph in reverse dependency order
func WithMaxConcurrency ¶
WithMaxConcurrency configure traversal to limit concurrency walking graph nodes
func WithRootNodesAndDown ¶
WithRootNodesAndDown creates a graphTraversal to start from selected nodes
Types ¶
type CollectorFn ¶
CollectorFn executes on each graph vertex based on visit order and return associated value
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
type VisitorFn ¶
VisitorFn executes on each graph nodes based on visit order
Source Files ¶
graph.go services.go traversal.go
- Version
- v2.0.0-rc.7
- Published
- Feb 15, 2024
- Platform
- js/wasm
- Imports
- 8 packages
- Last checked
- 52 minutes ago –
Tools for package owners.