dependency

package
v0.0.51 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Graph

type Graph struct {
	// contains filtered or unexported fields
}

Graph dependency graph for local charts in a source directory

func NewGraph

func NewGraph(dependencies map[string][]string) (*Graph, error)

NewGraph constructor for a dependency graph

func (*Graph) GetDependents

func (graph *Graph) GetDependents(chartName string) []string

Return the names of the dependents for the given chart

func (*Graph) TopoSort

func (graph *Graph) TopoSort(chartNames []string)

TopoSort will sort the given charts in topological order. Eg. suppose we have A <- B <- C (C depends on B, which depends on A) D <- E G H <- I <- J

TopoSort([]string{"C", "H", "E", "I", "B", "D"}) will sort to []{"D", "B", "H", "I", "C", "E"} (or another valid topological ordering)

This sort is not stable.

func (*Graph) WithTransitiveDependents

func (graph *Graph) WithTransitiveDependents(chartNames ...string) []string

Given a set of chart names, return the charts along with names of all transitive local dependents Eg. suppose we have A <- B <- C D <- E G H <- I <- J WithTransitiveDependents([]string{"A", "G", "I"}) will return []string{"A", "G", "B", "C", "I", "J"} (order not guaranteed)

Jump to

Keyboard shortcuts

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