pkggraph

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortNodes

func SortNodes(xs []*Node)

Types

type Graph

type Graph struct {
	Packages map[string]*Node
	Sorted   []*Node
	stat.Stat
}

func From

func From(pkgs map[string]*packages.Package) *Graph

From creates a new graph from a map of packages.

func (*Graph) AddNode

func (g *Graph) AddNode(n *Node)

type Node

type Node struct {
	*packages.Package
	Repo *vcs.RepoRoot

	ImportsNodes []*Node

	// Stats about the current node.
	stat.Stat
	// Stats about upstream nodes.
	Up stat.Stat
	// Stats about downstream nodes.
	Down stat.Stat

	Errors []error
	Graph  *Graph
}

func LoadNode

func LoadNode(p *packages.Package) *Node

func (*Node) MarshalJSON added in v0.4.5

func (p *Node) MarshalJSON() ([]byte, error)

func (*Node) Pkg

func (n *Node) Pkg() *packages.Package

Jump to

Keyboard shortcuts

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