graph

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WorkflowSample []byte

Functions

func ListAncestors

func ListAncestors(w *Workflow, amid string) int64s

List ancestors of a given vertice. It does depth-first search supported by a stack.

Types

type Vertex

type Vertex interface {
	graph.Node

	AMID() string
	Source() amjson.Vertex
	WithHighlight(bool)
}

Vertex is the fundamental unit to describe operations in the workflow.

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

VertexChainLink is a Vertex.

func (VertexChainLink) AMID

func (v VertexChainLink) AMID() string

func (VertexChainLink) Attributes

func (v VertexChainLink) Attributes() []encoding.Attribute

func (VertexChainLink) DOTID

func (v VertexChainLink) DOTID() string

func (VertexChainLink) ID

func (v VertexChainLink) ID() int64

func (VertexChainLink) IsHighlighted

func (h VertexChainLink) IsHighlighted() bool

func (VertexChainLink) Source

func (v VertexChainLink) Source() amjson.Vertex

func (VertexChainLink) String

func (v VertexChainLink) String() string

func (*VertexChainLink) WithHighlight

func (h *VertexChainLink) WithHighlight(v bool)
type VertexLink struct {
	// contains filtered or unexported fields
}

VertexLink is a Vertex.

func (VertexLink) AMID

func (v VertexLink) AMID() string

func (VertexLink) Attributes

func (v VertexLink) Attributes() []encoding.Attribute

func (VertexLink) DOTID

func (v VertexLink) DOTID() string

func (VertexLink) ID

func (v VertexLink) ID() int64

func (VertexLink) IsHighlighted

func (h VertexLink) IsHighlighted() bool

func (VertexLink) Source

func (v VertexLink) Source() amjson.Vertex

func (VertexLink) String

func (v VertexLink) String() string

func (*VertexLink) WithHighlight

func (h *VertexLink) WithHighlight(v bool)

type VertexWatcheDir

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

VertexWatcheDir is a Vertex.

func (VertexWatcheDir) AMID

func (v VertexWatcheDir) AMID() string

func (VertexWatcheDir) Attributes

func (v VertexWatcheDir) Attributes() []encoding.Attribute

func (VertexWatcheDir) DOTID

func (v VertexWatcheDir) DOTID() string

func (VertexWatcheDir) ID

func (v VertexWatcheDir) ID() int64

func (VertexWatcheDir) IsHighlighted

func (h VertexWatcheDir) IsHighlighted() bool

func (VertexWatcheDir) Source

func (v VertexWatcheDir) Source() amjson.Vertex

func (VertexWatcheDir) String

func (v VertexWatcheDir) String() string

func (*VertexWatcheDir) WithHighlight

func (h *VertexWatcheDir) WithHighlight(v bool)

type VizOpts

type VizOpts struct {
	// Render the full graph, which may have a significant impact in rendering times.
	Full bool
}

type Workflow

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

Workflow is a sequence of operations in Archivematica.

It is modeled as a simple directed graph.

func New

func New(data *amjson.WorkflowData) *Workflow

New returns a Workflow.

func (Workflow) Check

func (w Workflow) Check() error

Check looks for inconsistencies in the graph. It returns a multiError created with the go.uber.org/multierr module.

func (Workflow) DOT

func (w Workflow) DOT(opts *VizOpts) ([]byte, error)

func (*Workflow) DOTAttributers

func (w *Workflow) DOTAttributers() (graph, node, edge encoding.Attributer)

func (Workflow) Edge

func (w Workflow) Edge(uid, vid int64) graph.Edge

func (Workflow) From

func (w Workflow) From(id int64) graph.Nodes

func (Workflow) HasEdgeBetween

func (w Workflow) HasEdgeBetween(xid, yid int64) bool

func (Workflow) HasEdgeFromTo

func (w Workflow) HasEdgeFromTo(uid, vid int64) bool

Implement graph.Directed.

func (Workflow) Node

func (w Workflow) Node(id int64) graph.Node

Implement graph.Graph.

func (Workflow) Nodes

func (w Workflow) Nodes() graph.Nodes

func (*Workflow) SVG

func (w *Workflow) SVG(opts *VizOpts) ([]byte, error)

SVG returns a blob with the svg element generated by graphviz's dot tool.

func (Workflow) To

func (w Workflow) To(id int64) graph.Nodes

func (Workflow) VertexByAMID

func (w Workflow) VertexByAMID(amid string) Vertex

Vertex returns a workflow vertex given its AMD.

func (Workflow) VertexByID

func (w Workflow) VertexByID(id int64) Vertex

Vertex returns a workflow vertex given its ID.

Directories

Path Synopsis
Package encoding decodes the JSON-encoded workflow,
Package encoding decodes the JSON-encoded workflow,

Jump to

Keyboard shortcuts

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