Documentation
¶
Index ¶
- type Edge
- type Graph
- func (g *Graph) Add(n ...Node) *Graph
- func (g *Graph) Connect(from, to Node) *Graph
- func (g *Graph) Count() int
- func (g *Graph) Filter(filter NodeFilter) (result []Node)
- func (g *Graph) From(n Node) []Node
- func (g *Graph) GetNode(nodeID string) (Node, bool)
- func (g *Graph) Remove(n ...Node) *Graph
- func (g *Graph) Sort() ([]Node, error)
- func (g *Graph) To(n Node) []Node
- func (g *Graph) Visit(callback VisitCallback)
- type Node
- type NodeFilter
- type VisitCallback
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
}
Graph used to sort Components based on dependencies
func (*Graph) Filter ¶
func (g *Graph) Filter(filter NodeFilter) (result []Node)
Filter nodes in the Graph
func (*Graph) From ¶
From returns all nodes in the graph that can be reached directly from the specified Node
func (*Graph) GetNode ¶
GetNode returns the Node with the specified ID and a boolean indicating whether it was found
func (*Graph) Visit ¶
func (g *Graph) Visit(callback VisitCallback)
Visit all nodes in the Graph and call the provided callback for each
type Node ¶
type Node interface {
NodeID() string
}
Node defines NodeID() which is used to identify a Node in a Graph
type VisitCallback ¶
VisitCallback is a function signature for visiting nodes in the graph
Click to show internal directories.
Click to hide internal directories.