Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultResourceGraph ¶
func NewDefaultResourceGraph() *defaultResourceGraph
NewDefaultResourceGraph constructs new defaultResourceGraph.
func TopologicalTraversal ¶
func TopologicalTraversal(graph ResourceGraph, visitFunc func(uid ResourceUID) error) error
TopologicalTraversal will traversal nodes in typological order. @TODO: change this traversal to be parallel.
Types ¶
type ResourceGraph ¶
type ResourceGraph interface { // Add a node into ResourceGraph. AddNode(node ResourceUID) // Add a edge into ResourceGraph, where dstNode depends on srcNode. AddEdge(srcNode ResourceUID, dstNode ResourceUID) // Nodes returns all nodes in ResourceGraph. Nodes() []ResourceUID // OutEdgeNodes returns all nodes that depends on this node. OutEdgeNodes(node ResourceUID) []ResourceUID }
ResourceGraph is an abstraction of resource DAG.
type ResourceUID ¶
unique ID for a resource.
Click to show internal directories.
Click to hide internal directories.