Categorygithub.com/streemtech/dagg
modulepackage
0.0.3
Repository: https://github.com/streemtech/dagg.git
Documentation: pkg.go.dev

# README

Golang DAG[ T ] (Directed Acyclic Graph)

This is a generic DAG based largely on the work of Hashicorp. The intent of this library is to allow for anyone to create a DAG using any datatype so long as it implements Hashcode() string, that does not require casting the interface upon getting from the dag. The files in this code were taken from this commit

# Functions

simple convenience helper for converting a dag.Set to a []Vertex.
BasicEdge returns an Edge implementation that simply tracks the source and target given as-is.
StronglyConnected returns the list of strongly connected components within the Graph g.
VertexName returns the name of a vertex.

# Structs

AcyclicGraph is a specialization of Graph that cannot have cycles.
DotNode provides a structure for Vertices to return in order to specify their dot format.
DotOpts are the options for generating a dot formatted Graph.
Graph is used to represent a dependency graph.

# Interfaces

Edge represents an edge in the graph, with a source and target vertex.
A Grapher is any type that returns a Grapher, mainly used to identify dag.Graph and dag.AcyclicGraph.
GraphNodeDotter can be implemented by a node to cause it to be included in the dot graph.
Hashable is the interface used by set to get the hash code of a value.
NamedVertex is an optional interface that can be implemented by Vertex to give it a human-friendly name that is used for outputting the graph.
Subgrapher allows a Vertex to be a Graph itself, by returning a Grapher.

# Type aliases

DepthWalkFunc is a walk function that also receives the current depth of the walk as an argument.
Set is a set data structure.
WalkFunc is the callback used for walking the graph.