dag

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: Apache-2.0 Imports: 0 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dag

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

Dag is a directed acyclic graph.

func New

func New() *Dag

New creates a new directed acyclic graph (dag) that can determinate if a stage has dependencies.

func (*Dag) Add

func (d *Dag) Add(from string, to ...string) *Vertex

Add establishes a dependency between two vertices in the graph.

func (*Dag) Ancestors

func (d *Dag) Ancestors(name string) []*Vertex

Ancestors returns the ancestors of the vertex.

func (*Dag) Dependencies

func (d *Dag) Dependencies(name string) []string

Dependencies returns the direct dependencies accounting for skipped dependencies.

func (*Dag) DetectCycles

func (d *Dag) DetectCycles() bool

DetectCycles returns true if cycles are detected in the graph.

func (*Dag) Get

func (d *Dag) Get(name string) (*Vertex, bool)

Get returns the vertex from the graph.

type Vertex

type Vertex struct {
	Name string
	Skip bool
	// contains filtered or unexported fields
}

Vertex is a vertex in the graph.

Jump to

Keyboard shortcuts

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