Documentation ¶
Overview ¶
Package depgraph provides an efficient golang dependency analysis tool for large modules. It builds the graph by inspecting file imports only, which is faster than go list or ast parsing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mod ¶
type Mod struct { // Path of the module: github.com/luno/reflex Path string // Dir of the module on local disk. Dir string }
func (Mod) MaybeHasPkg ¶
MaybeHasPkg returns true if the package name matches the module. It might not actually exist though.
type Node ¶
type Node struct { // Name is the package path. Name string // Children are all direct downstream packages this package imports. Children []*Node // Descendants is union of all downstream packages. // Only internal packages (same module) are expanded. Descendants map[*Node]bool // Parents are direct upstream packages importing this package. Parents []*Node // Height is depth of deepest internal branch (chain of same module descendants). Height int // FileImports are the imports per go file (relative to module dir). // Only applicable files are included, so _test.go files and mismatching build tags are excluded. FileImports map[string][]string // contains filtered or unexported fields }
Node represents a package in a import/dependency graph.
func Make ¶
Make returns a dependency graph with the provided packages as root nodes.
Only internal imports (packages of the provided module) are expanded. Only direct external imports (packages of other modules) are included if inclExt is true.
Build tags are respected and _test.go files are excluded.