graph

package
v2.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCycle added in v2.0.1

func CheckCycle(project *types.Project) error

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

func WithMaxConcurrency(max int) func(*Options)

WithMaxConcurrency configure traversal to limit concurrency walking graph nodes

func WithRootNodesAndDown

func WithRootNodesAndDown(nodes []string) func(*Options)

WithRootNodesAndDown creates a graphTraversal to start from selected nodes

Types

type CollectorFn

type CollectorFn[S any, T any] func(context.Context, string, S) (T, error)

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

type VisitorFn[S any] func(context.Context, string, S) error

VisitorFn executes on each graph nodes based on visit order

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL