package
module
Version:
v0.0.0-...-96dbfd1
Opens a new window with list of versions in this module.
Published: Nov 15, 2022
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Graph defines the extended tree structure
AddNode method includes a new node on the tree
AddRelationship method update the parent-child relationship between two nodes
DrawGraph method prints the graph
Exist return if a node already exists on the graph
GetNode method returns the node which matches to the gived name
HasCycles returns whether a cyclic dependency exists on the whole graph. It calls hasCyclesRec by each root node
type Node struct {
Name string
Item interface{}
Parents []*Node
Children []*Node
}
Node is the extended tree graph node
AddChild method update node's childs list adding a new one
AddParent method update node's parents list adding a new one. It also update parent's childs list
HasChild method validate whether a child node already exists in node's child list. Two nodes are equal when they have the same node name
HasParent method validate whether a parent node already exists in node's parent list. Two nodes are equal when they have the same node name
Source Files
¶
Click to show internal directories.
Click to hide internal directories.