Documentation
¶
Index ¶
- type Builder
- type Graph
- func (g *Graph) AddEdge(from, to string)
- func (g *Graph) AddNode(node *Node)
- func (g *Graph) GetAllNodes() map[string]*Node
- func (g *Graph) GetDependencies(module string) []string
- func (g *Graph) GetDependents(module string) []string
- func (g *Graph) GetNode(name string) (*Node, bool)
- func (g *Graph) HasCycle() bool
- func (g *Graph) TopologicalSort() ([][]string, error)
- func (g *Graph) TopologicalSortWithFilter(nodesToConsider map[string]bool) ([][]string, error)
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder constructs a dependency graph for all workspaces
func NewBuilder ¶
NewBuilder creates a new dependency graph builder
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph represents the dependency graph of all modules
func BuildGraph ¶
BuildGraph builds a dependency graph from the workspace
func (*Graph) GetAllNodes ¶
GetAllNodes returns all nodes in the graph
func (*Graph) GetDependencies ¶
GetDependencies returns the direct dependencies of a module
func (*Graph) GetDependents ¶
GetDependents returns the modules that depend on the given module
func (*Graph) TopologicalSort ¶
TopologicalSort performs a topological sort of the graph using Kahn's algorithm Returns modules grouped by levels that can be released in parallel
func (*Graph) TopologicalSortWithFilter ¶
TopologicalSortWithFilter performs a topological sort on a subset of nodes If nodesToConsider is nil, sorts the entire graph If nodesToConsider is provided, only considers dependencies within that set
type Node ¶
type Node struct {
Name string // Module name (e.g., "grove-core")
Path string // Full module path (e.g., "github.com/grovetools/core")
Dir string // Directory path
Deps []string // Direct dependencies (module paths)
Version string // Current version (if known)
}
Node represents a module in the dependency graph