dep_tree

package
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ConnectorDestinationNodeIdTag = "connectorDestination"
View Source
const ConnectorOriginNodeIdTag = "connectorOrigin"
View Source
const NodeFromTag = "nodeFrom"
View Source
const NodeIdTag = "nodeId"
View Source
const NodeIndexTag = "nodeIndex"

Variables

This section is empty.

Functions

func PrintStructured

func PrintStructured[T any](
	files []string,
	parser NodeParser[T],
) (string, error)

Types

type DepTree

type DepTree[T any] struct {
	// Info present on DepTree construction.
	Ids []string
	NodeParser[T]
	// Info present just after node processing.
	Graph       *graph.Graph[T]
	Entrypoints []*graph.Node[T]
	Nodes       []*DepTreeNode[T]
	Cycles      *orderedmap.OrderedMap[[2]string, graph.Cycle]
	// contains filtered or unexported fields
}

func NewDepTree

func NewDepTree[T any](parser NodeParser[T], ids []string) *DepTree[T]

func (*DepTree[T]) LoadCycles added in v0.17.4

func (dt *DepTree[T]) LoadCycles()

func (*DepTree[T]) LoadDeps added in v0.17.4

func (dt *DepTree[T]) LoadDeps() error

func (*DepTree[T]) LoadGraph added in v0.17.4

func (dt *DepTree[T]) LoadGraph() error

func (*DepTree[T]) LoadNodes added in v0.17.4

func (dt *DepTree[T]) LoadNodes() error

func (*DepTree[T]) Render

func (dt *DepTree[T]) Render() (*board.Board, error)

func (*DepTree[T]) RenderStructured

func (dt *DepTree[T]) RenderStructured() ([]byte, error)

func (*DepTree[T]) WithStdErrLoader added in v0.19.0

func (dt *DepTree[T]) WithStdErrLoader() *DepTree[T]

type DepTreeNode

type DepTreeNode[T any] struct {
	Node *graph.Node[T]
	Lvl  int
}

type NodeParser

type NodeParser[T any] interface {
	Display(node *graph.Node[T]) string
	Node(id string) (*graph.Node[T], error)
	Deps(node *graph.Node[T]) ([]*graph.Node[T], error)
}

type NodeParserBuilder added in v0.13.5

type NodeParserBuilder[T any] func([]string) (NodeParser[T], error)

type StructuredTree

type StructuredTree struct {
	Tree                 map[string]interface{} `json:"tree" yaml:"tree"`
	CircularDependencies [][]string             `json:"circularDependencies" yaml:"circularDependencies"`
	Errors               map[string][]string    `json:"errors" yaml:"errors"`
}

type TestParser

type TestParser struct {
	Spec [][]int
}

func (*TestParser) Deps

func (t *TestParser) Deps(n *graph.Node[[]int]) ([]*graph.Node[[]int], error)

func (*TestParser) Display

func (t *TestParser) Display(n *graph.Node[[]int]) string

func (*TestParser) Node added in v0.19.0

func (t *TestParser) Node(id string) (*graph.Node[[]int], error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL