graph

package
v0.0.0-...-446135d Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

The `graph` package contains the annotation functions for graph-based tracking of program flow. This representation uses graphviz as an underlying data model, and exports to .gz files. Representation capacity is limited, so only simple data relations are modelled

Index

Constants

This section is empty.

Variables

View Source
var (

	// Local pointer to global state, can be reset for testing
	StateManager = &store.StateManager
)

Functions

func Convert

func Convert(graphData Graph) (dotGraph graph.Graph[string, string])

Conversion function to map from topo.graph to exportable graphviz format

func ExportGraphDot

func ExportGraphDot(graph graph.Graph[string, string], file io.Writer)

Function for handling the graphviz write operation

Types

type Collection

Collector object for shared state

type Constructor

Collector object for shared state

type Edge

type Edge = topo.Edge[EdgeStyle]

Edge format required for graphviz constructor

type EdgeStyle

type EdgeStyle struct {
	Colour string
}

Edge styling parameters for graph conversion

func ErrorEdge

func ErrorEdge() EdgeStyle

Creates red edge to highlight error paths

func StandardEdge

func StandardEdge() EdgeStyle

Standard black edge for conventional program links

type Graph

type Graph = topo.Graph[VertexStyle, EdgeStyle]

Data storage maps for collector

type Node

type Node = tracker.Node[Constructor]

Tracking data object

func End

func End(tracker *Tracker, inputs []Node, name, description string, isReturned, isError bool) (node Node)

Action annotation for marking the endpoints of a process flow

func Start

func Start(tracker *Tracker, name, description string) (node Node)

Action annotation for marking start of a process flow

func Task

func Task(ctx context.Context, tracker *Tracker, inputs []Node, name, description string) (ctxNew context.Context, node Node)

Action annotation for marking intermediate tasks of a process

type Singleton

type Singleton = store.GlobalState[Collection]

Shared memory format for graph tracker

type Tracker

String node-based flow tracker

func RegisterTracker

func RegisterTracker(ctx context.Context) (t Tracker)

Initialises graphviz-based graph tracking object with required params

type Vertex

type Vertex = topo.Vertex[VertexStyle]

Vertex format required for graphviz constructor

func EndingVertex

func EndingVertex(name, parentFlow string, isError bool, isReturned bool) Vertex

Final circular vertex with no child nodes

func StartingVertex

func StartingVertex(name, parentFlow string) Vertex

Initial circular vertex with no corresponding edge

func TaskVertex

func TaskVertex(name, parentFlow string) Vertex

Intermediate task node denoting process activity

type VertexStyle

type VertexStyle struct {
	Colour      string
	Shape       string
	ParentFlow  string
	IsFlowStart bool
}

Vertex styling parameters for graph conversion

Jump to

Keyboard shortcuts

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