package graph
import "github.com/compose-spec/compose-go/v2/graph"
Index ¶
- func CheckCycle(project *types.Project) error
- 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 CheckCycle ¶
CheckCycle analyze project's depends_on relation and report an error on cycle detection
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 ¶
cycle.go graph.go services.go traversal.go
- Version
- v2.4.8 (latest)
- Published
- Feb 10, 2025
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 2 months ago –
Tools for package owners.