Documentation
¶
Overview ¶
Package graph is the pure, kind-agnostic dependsOn DAG: no Kubernetes, no I/O. It derives strongly connected components (cycles), transitive ancestors, and unknown (dangling) edge targets from a flat edge map of adapter.NodeRef.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph is the derived dependsOn graph. It is immutable after Build except for the TransitiveAncestors memoization cache, which is safe for concurrent use.
func Build ¶
Build constructs the DAG from nodes and their dependsOn edges. Edges to refs absent from nodes are auto-registered as external nodes (retrievable via Unknown()); the caller decides their semantics. Build never fails: cycles are reported, not errors.
func (*Graph) Cycles ¶
Cycles returns the strongly connected components with len > 1 (plus self-loops). Each member list is sorted by String(); the outer list is sorted by its first member.
func (*Graph) DependsOn ¶
DependsOn returns ref's direct dependencies, deduplicated and sorted by String(). It returns nil for a ref unknown to the graph.
func (*Graph) InCycle ¶
InCycle reports whether ref belongs to, or transitively depends on, a cycle.
func (*Graph) TransitiveAncestors ¶
TransitiveAncestors returns every ancestor reachable via dependsOn (memoized), deduplicated and sorted by String().