Documentation ¶
Index ¶
- type DepGraph
- func (g *DepGraph) AddNode(module *Module) (*Node, bool)
- func (g *DepGraph) DeepCopy() *DepGraph
- func (g *DepGraph) Depth() int
- func (g *DepGraph) Main() *Node
- func (g *DepGraph) Node(name string) (*Node, bool)
- func (g *DepGraph) Nodes() *NodeMap
- func (g *DepGraph) PruneUnsharedDeps() *DepGraph
- func (g *DepGraph) SubGraph(filters []*DependencyFilter) *DepGraph
- type DependencyFilter
- type Module
- type ModuleError
- type Node
- type NodeMap
- type NodeReference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DepGraph ¶
type DepGraph struct {
// contains filtered or unexported fields
}
DepGraph represents a Go module's dependency graph.
func GetDepGraph ¶
GetDepGraph should be called from within a Go module. It will return the dependency graph for this module. The 'logger' parameter can be 'nil' which will result in no output or logging information to be provided.
func NewGraph ¶
NewGraph returns a new DepGraph instance which will use the specified logger for writing log output. If nil a null-logger will be used instead.
func (*DepGraph) DeepCopy ¶
DeepCopy returns a separate copy of the current dependency graph that can be safely modified without affecting the original graph. The logger argument can be nil in which case nothing will be logged.
func (*DepGraph) PruneUnsharedDeps ¶
PruneUnsharedDeps returns a copy of the dependency graph with all nodes removed that are not part of a chain leading to a node with more than two predecessors.
func (*DepGraph) SubGraph ¶
func (g *DepGraph) SubGraph(filters []*DependencyFilter) *DepGraph
SubGraph returns a copy of the dependency graph with all nodes that are part of dependency chains that need to be modified for the specified dependency to be set to a given target version annotated as such.
type DependencyFilter ¶
DependencyFilter allows to specify a dependency graph filter that removes any edges that are not part of a chain leading to this dependency. If a version is given then we only keep edges that prevent the use of the dependency at that given version due to the Go module's minimal version selection.
type Module ¶
type Module struct { Main bool // is this the main module? Path string // module path Replace *Module // replaced by this module Version string // module version Time *time.Time // time version was created Update *Module // available update, if any (with -u) GoMod string // the path to this module's go.mod file Error *ModuleError // error loading module }
type ModuleError ¶
type ModuleError struct {
Err string // the error itself
}
type Node ¶
Node represents a module in a Go module's dependency graph.
func (*Node) SelectedVersion ¶
SelectedVersion corresponds to the version of the dependency represented by this Node which was selected for use.
type NodeMap ¶
type NodeMap struct {
// contains filtered or unexported fields
}
func NewNodeMap ¶
func NewNodeMap() *NodeMap
func (*NodeMap) Add ¶
func (m *NodeMap) Add(nodeReference *NodeReference)
func (*NodeMap) List ¶
func (m *NodeMap) List() []*NodeReference