dag

package
v0.29.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DAG

type DAG struct {
	NameMap map[string]*Node
}

DAG is a simple implementation of a directed acyclic graph.

func NewDAG

func NewDAG() *DAG

func (*DAG) Add

func (d *DAG) Add(name string, dependants []string) (*Node, error)

func (*DAG) Delete

func (d *DAG) Delete(name string)

func (*DAG) GetChildren

func (d *DAG) GetChildren(name string) []string

GetChildren only returns the immediate children

func (*DAG) GetDeepChildren added in v0.19.0

func (d *DAG) GetDeepChildren(name string) []string

GetDeepChildren will go down the DAG and get all children in the subtree

func (*DAG) GetParents added in v0.19.0

func (d *DAG) GetParents(name string) []string

GetParents only returns the immediate parents

func (*DAG) Has

func (d *DAG) Has(name string) bool

func (*DAG) TopologicalSort added in v0.24.4

func (d *DAG) TopologicalSort() []string

type Node

type Node struct {
	Name     string
	Present  bool
	Parents  map[string]*Node
	Children map[string]*Node
}

Jump to

Keyboard shortcuts

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