Documentation
¶
Overview ¶
Copyright 2020 Fugue, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
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