xml: aqwari.net/xml/internal/dependency Index | Files

package dependency

import "aqwari.net/xml/internal/dependency"

Package dependency builds and flattens dependency graphs.


Package Files


type Graph Uses

type Graph struct {
    // contains filtered or unexported fields

A Graph is a collection of targets and their dependencies.

func (*Graph) Add Uses

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

Add adds a dependency to a Graph.

func (*Graph) Flatten Uses

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 Uses

func (g *Graph) Len() int

Len returns the number of targets in the graph.

Package dependency imports 2 packages (graph) and is imported by 2 packages. Updated 2018-11-05. Refresh now. Tools for package owners.