dag

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Graph

type Graph struct {
	Roots   []*Node          // nodes with no dependencies (in-degree 0)
	ByName  map[string]*Node // O(1) service lookup
	Ordered []*Node          // all nodes in topological order (Kahn's)
	Visual  []*Node          // nodes in depth-first render order (matches tree row positions)
}

Graph holds the full dependency graph.

func Build

func Build(cfg *compose.Config) (*Graph, error)

Build constructs the DAG from a parsed compose Config. Returns an error if a circular dependency is detected.

type Node

type Node struct {
	Name         string
	Deps         []string // all dependency names (sorted, for display)
	Children     []*Node  // all services that depend on this node (full edge set, used by Kahn's)
	TreeChildren []*Node  // dependants for which this node is the primary parent (used by renderer)
	State        docker.ContainerState
	Level        int // render depth: root = 0
}

Node represents a single service in the dependency graph.

Jump to

Keyboard shortcuts

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