dependency

package
v0.0.0-...-d9421b2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package dependency builds and flattens dependency graphs.

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
}

A Graph is a collection of targets and their dependencies.

func (*Graph) Add

func (g *Graph) Add(target, dependency int)

Add adds a dependency to a Graph.

func (*Graph) Flatten

func (g *Graph) Flatten(walk func(int))

Flatten calls the walk function on each node in the Graph in topological order, starting with the leaves and traversing up to the roots. The same Graph will always be traversed in the same order.

Every vertex in the Graph is visited once; any cycles in the graph are skipped.

func (*Graph) Len

func (g *Graph) Len() int

Len returns the number of targets in the graph.

Jump to

Keyboard shortcuts

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