dag2

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: MIT Imports: 4 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
}

func New

func New() *Graph

func (*Graph) Ancestors

func (g *Graph) Ancestors(path string) (ancestors []string)

Ancestors recursively returns parents, parents of parents, etc.

func (*Graph) Children

func (g *Graph) Children(from string) (tos []string)

Return the links out (dependencies)

func (*Graph) Descendants

func (g *Graph) Descendants(path string) (descendants []string)

Descendants recursively returns children, children of children, etc. Descendants includes self.

func (g *Graph) Link(from, to string)

func (*Graph) Nodes

func (g *Graph) Nodes() (nodes []string)

func (*Graph) Parents

func (g *Graph) Parents(to string) (froms []string)

Return the links in (parents)

func (*Graph) Remove

func (g *Graph) Remove(paths ...string)

Remove a node

func (*Graph) Set

func (g *Graph) Set(path string)

func (*Graph) ShortestPath

func (g *Graph) ShortestPath(start, end string) (nodes []string, err error)

func (*Graph) ShortestPathOf

func (g *Graph) ShortestPathOf(start string, ends []string) (nodes []string, err error)

func (*Graph) String

func (g *Graph) String() string

String returns a digraph

Jump to

Keyboard shortcuts

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