Documentation
¶
Overview ¶
Package dependencies builds and renders the Atmos component dependency graph for the `atmos list dependencies` command. Unlike the execution-ordering graph used by the scheduler (which rejects cycles), this builder is cycle-tolerant so the command can visualize circular dependencies instead of failing on them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildGraph ¶
func BuildGraph(stacks map[string]any) (*dependency.Graph, error)
BuildGraph constructs a cycle-tolerant dependency graph from the described stacks map. It adds a node for every concrete (non-abstract, enabled) terraform component and an edge for every component-to-component dependency declared via either `dependencies.components` (preferred) or the legacy `settings.depends_on`. Edges to targets that are not present in the graph (e.g. disabled or filtered-out components) are skipped.
func NodeID ¶
NodeID returns the canonical, collision-safe node ID for a component in a stack. It uses a length-prefixed encoding so that component/stack names containing the delimiter character never produce the same ID for distinct (component, stack) pairs (e.g. "app-prod"+"us" vs "app"+"prod-us").
Types ¶
type Direction ¶
type Direction string
Direction selects which dependency edges to display.
const ( // DirectionBoth shows both what a component depends on and what depends on it. DirectionBoth Direction = "both" // DirectionForward shows what a component depends on. DirectionForward Direction = "forward" // DirectionReverse shows what depends on a component (its dependents). DirectionReverse Direction = "reverse" )
type Options ¶
type Options struct {
// Format is the output format: tree (default), json, or yaml.
Format string
// Direction selects forward, reverse, or both edge directions.
Direction Direction
// Component optionally filters the top-level entries to a single component.
Component string
// Stack optionally filters the top-level entries to a single stack.
Stack string
}
Options configures dependency rendering.