funcgraph

package module
v0.0.0-...-0cec0f4 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NodeTerminal is used for terminal nodes, usually the beginnings or ends of processes.
	// It is represented by a grey oval.
	NodeTerminal = NodeType(iota)

	// NodeProcess is used for general-purpose processing nodes.
	// It is represented by a blue rectangle.
	NodeProcess

	// NodeDecision is used for control flow decisions, such as if statements and switch statements.
	// It is represented by a green diamond.
	NodeDecision

	// NodePreparation is used for preparation or initialisation steps, such as setting up subroutines or iterations.
	// It is represented by an orange elongated hexagon.
	NodePreparation

	// NodeInput is used for data inputs, such as from databases or manual inputs by a user.
	// It is represented by dark turquoise parallelogram.
	NodeInput

	// NodeOutput is used for data outputs, such as writing to a file or to a database.
	// It is represented by dark violet parallelogram.
	NodeOutput
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Graph

type Graph struct {
	// contains filtered or unexported fields
}

func NewGraph

func NewGraph() *Graph

func (*Graph) Collect

func (graph *Graph) Collect()

func (*Graph) Head

func (graph *Graph) Head() *Node

func (*Graph) MarshalDOT

func (graph *Graph) MarshalDOT() ([]byte, error)

func (*Graph) NewNode

func (graph *Graph) NewNode(label string, typ NodeType) *Node

func (*Graph) NewSubgraph

func (graph *Graph) NewSubgraph(head, tail *Node) *Graph

func (*Graph) SetError

func (graph *Graph) SetError(err error) error

SetError wraps an error with the label of the last added node and returns it, setting the node error in the process. If no nodes have been added to the graph, the original error is returned as-is.

func (*Graph) Tail

func (graph *Graph) Tail() *Node

type Node

type Node struct {
	Err error
	// contains filtered or unexported fields
}

func (*Node) Attributes

func (node *Node) Attributes() []encoding.Attribute

Attributes implements encoding.Attributer.

func (*Node) DOTID

func (node *Node) DOTID() string

DOTID implements dot.Node.

func (*Node) ID

func (node *Node) ID() int64

ID returns the ID of this node.

type NodeType

type NodeType int

Jump to

Keyboard shortcuts

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