Documentation ¶
Index ¶
- type DepGraph
- func (g *DepGraph) AddDependency(module *modules.Module) *Dependency
- func (g *DepGraph) DeepCopy() *DepGraph
- func (g *DepGraph) GetDependency(name string) (*Dependency, bool)
- func (g *DepGraph) PruneUnsharedDeps() *DepGraph
- func (g *DepGraph) RemoveDependency(name string)
- func (g *DepGraph) SubGraph(filters []*DependencyFilter) *DepGraph
- type Dependency
- type DependencyFilter
- type DependencyMap
- func (m *DependencyMap) Add(dependencyReference *DependencyReference)
- func (m *DependencyMap) Copy() *DependencyMap
- func (m *DependencyMap) Delete(name string)
- func (m *DependencyMap) Get(name string) (*DependencyReference, bool)
- func (m *DependencyMap) Len() int
- func (m *DependencyMap) List() []*DependencyReference
- type DependencyReference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DepGraph ¶
type DepGraph struct { Path string Main *Dependency Dependencies *DependencyMap // contains filtered or unexported fields }
DepGraph represents a Go module's dependency graph.
func GetDepGraph ¶
GetDepGraph will return the dependency graph for the Go module that can be found at the specified path. The 'logger' parameter can be 'nil' which will result in no output or logging information being 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) AddDependency ¶ added in v0.5.0
func (g *DepGraph) AddDependency(module *modules.Module) *Dependency
func (*DepGraph) DeepCopy ¶
DeepCopy returns a separate copy of the current dependency graph that can be safely modified without affecting the original graph.
func (*DepGraph) GetDependency ¶ added in v0.5.0
func (g *DepGraph) GetDependency(name string) (*Dependency, bool)
func (*DepGraph) PruneUnsharedDeps ¶
PruneUnsharedDeps returns a copy of the dependency graph with all dependencies removed that are not part of a chain leading to a dependency with more than two predecessors.
func (*DepGraph) RemoveDependency ¶ added in v0.5.0
func (*DepGraph) SubGraph ¶
func (g *DepGraph) SubGraph(filters []*DependencyFilter) *DepGraph
SubGraph returns a copy of the dependency graph with all dependencies that are part of chains that need to be modified for the specified dependency to be set to a given target version annotated as such.
type Dependency ¶ added in v0.5.0
type Dependency struct { Module *modules.Module Predecessors *DependencyMap Successors *DependencyMap }
Dependency represents a module in a Go module's dependency graph.
func (*Dependency) Name ¶ added in v0.5.0
func (n *Dependency) Name() string
Name of the module represented by this Dependency in the DepGraph instance.
func (*Dependency) SelectedVersion ¶ added in v0.5.0
func (n *Dependency) SelectedVersion() string
SelectedVersion corresponds to the version of the dependency represented by this Dependency which was selected for use.
func (*Dependency) Timestamp ¶ added in v0.5.0
func (n *Dependency) Timestamp() *time.Time
Timestamp returns the time corresponding to the creation of the version at which this dependency is used.
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 DependencyMap ¶ added in v0.5.0
type DependencyMap struct {
// contains filtered or unexported fields
}
func NewDependencyMap ¶ added in v0.5.0
func NewDependencyMap() *DependencyMap
func (*DependencyMap) Add ¶ added in v0.5.0
func (m *DependencyMap) Add(dependencyReference *DependencyReference)
func (*DependencyMap) Copy ¶ added in v0.5.0
func (m *DependencyMap) Copy() *DependencyMap
func (*DependencyMap) Delete ¶ added in v0.5.0
func (m *DependencyMap) Delete(name string)
func (*DependencyMap) Get ¶ added in v0.5.0
func (m *DependencyMap) Get(name string) (*DependencyReference, bool)
func (*DependencyMap) Len ¶ added in v0.5.0
func (m *DependencyMap) Len() int
func (*DependencyMap) List ¶ added in v0.5.0
func (m *DependencyMap) List() []*DependencyReference
type DependencyReference ¶ added in v0.5.0
type DependencyReference struct { *Dependency VersionConstraint string }