Documentation
¶
Index ¶
- type Cycle
- type Edge
- type EmptyCallbacks
- type Graph
- func (g *Graph[T]) AddFromToEdge(fromId string, toIds ...string) error
- func (g *Graph[T]) AddNode(node *Node[T])
- func (g *Graph[T]) AllNodes() []*Node[T]
- func (g *Graph[T]) Edge(uid, vid int64) graph.Edge
- func (g *Graph[T]) From(id int64) graph.Nodes
- func (g *Graph[T]) FromId(id string) []*Node[T]
- func (g *Graph[T]) Get(id string) *Node[T]
- func (g *Graph[T]) GetNodesWithoutParents() []*Node[T]
- func (g *Graph[T]) Has(nodeId string) bool
- func (g *Graph[T]) HasEdgeBetween(xid, yid int64) bool
- func (g *Graph[T]) HasEdgeFromTo(uid, vid int64) bool
- func (g *Graph[T]) Load(ids []string, parser NodeParser[T], callbacks LoadCallbacks[T]) error
- func (g *Graph[T]) Node(id int64) graph.Node
- func (g *Graph[T]) Nodes() graph.Nodes
- func (g *Graph[T]) RemoveCycles(nodes []*Node[T]) []Cycle
- func (g *Graph[T]) RemoveCyclesStartingFromNode(node *Node[T]) []Cycle
- func (g *Graph[T]) RemoveElementaryCycles() []Cycle
- func (g *Graph[T]) RemoveFromToEdge(fromId string, toId string)
- func (g *Graph[T]) To(id int64) graph.Nodes
- func (g *Graph[T]) ToId(id string) []*Node[T]
- type LoadCallbacks
- type Node
- type NodeParser
- type NodeParserBuilder
- type Nodes
- type StdErrCallbacks
- type TestCallbacks
- type TestParser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Edge ¶ added in v0.17.4
type Edge[T any] struct { // contains filtered or unexported fields }
func (*Edge[T]) ReversedEdge ¶ added in v0.17.4
type EmptyCallbacks ¶ added in v0.19.6
type EmptyCallbacks[T any] struct{}
type Graph ¶
type Graph[T any] struct { // contains filtered or unexported fields }
func MakeTestGraph ¶ added in v0.17.4
func (*Graph[T]) AddFromToEdge ¶ added in v0.17.4
func (*Graph[T]) GetNodesWithoutParents ¶ added in v0.19.0
func (*Graph[T]) HasEdgeBetween ¶ added in v0.17.4
func (*Graph[T]) HasEdgeFromTo ¶ added in v0.17.4
func (*Graph[T]) Load ¶ added in v0.19.6
func (g *Graph[T]) Load(ids []string, parser NodeParser[T], callbacks LoadCallbacks[T]) error
func (*Graph[T]) RemoveCycles ¶ added in v0.17.4
RemoveCycles removes all cycles in the graph, giving preference to cycles that start from the provided nodes.
func (*Graph[T]) RemoveCyclesStartingFromNode ¶ added in v0.19.6
RemoveCyclesStartingFromNode removes cycles that appear in order while performing a depth first search from a certain node. Note that this may not remove all cycles in the graph.
func (*Graph[T]) RemoveElementaryCycles ¶ added in v0.19.6
RemoveElementaryCycles removes all the elementary cycles in the graph. The result of this can be non-deterministic.
func (*Graph[T]) RemoveFromToEdge ¶ added in v0.17.4
type LoadCallbacks ¶ added in v0.19.6
type LoadCallbacks[T any] interface { // contains filtered or unexported methods }
type Node ¶
type Node[T any] struct { // Id identifies the node with a string. This is typically the absolute path // of a file in dep-tree. Id string // Errors This node might hold some errors that are worth rendering to the user. // For example, if the node is a file, maybe it failed to be parsed. Errors []error // Data is a generic implementation-defined data bucket. Implementations can put // whatever they want here. Data T }
type NodeParser ¶ added in v0.19.6
type NodeParserBuilder ¶ added in v0.19.6
type NodeParserBuilder[T any] func([]string) (NodeParser[T], error)
type Nodes ¶ added in v0.17.4
type Nodes[T any] struct { // contains filtered or unexported fields }
func NewNodesIterator ¶ added in v0.17.4
type StdErrCallbacks ¶ added in v0.19.6
type StdErrCallbacks[T any] struct { // contains filtered or unexported fields }
func NewStdErrCallbacks ¶ added in v0.19.6
func NewStdErrCallbacks[T any]( display func(node *Node[T]) string, ) *StdErrCallbacks[T]
type TestCallbacks ¶ added in v0.19.6
type TestCallbacks[T any] struct { // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.