taskgraph

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintAllGraphs added in v0.2.0

func PrintAllGraphs(graphs []*TaskGraph, outputFormat string, withTaskRef bool) error

Function that prints graph to stdout

func WriteAllGraphs added in v0.2.0

func WriteAllGraphs(graphs []*TaskGraph, outputFormat string, outputDir string, withTaskRef bool) error

Function that writes graph to file

Types

type DOT

type DOT struct {
	Name   string
	Edges  []string
	Format string
}

func (*DOT) String

func (d *DOT) String() string

String converts a DOT graph to a string

type TaskGraph

type TaskGraph struct {
	PipelineName string
	Nodes        map[string]*TaskNode
}

func BuildTaskGraph

func BuildTaskGraph(tasks []v1pipeline.PipelineTask) *TaskGraph

In the case where the order of tasks is arbitrary, it is necessary to create all the nodes first and then add the dependencies in a separate loop (since dependencies doesn't exist in TaskRef). BuildTaskGraph creates a TaskGraph from a list of PipelineTasks

func (*TaskGraph) ToDOT

func (g *TaskGraph) ToDOT() *DOT

ToDOT converts a TaskGraph to a DOT graph

func (*TaskGraph) ToDOTWithTaskRef

func (g *TaskGraph) ToDOTWithTaskRef() *DOT

ToDOTWithTaskRef converts a TaskGraph to a DOT graph

func (*TaskGraph) ToMermaid

func (g *TaskGraph) ToMermaid() string

ToMermaid converts a TaskGraph to a mermaid graph

func (*TaskGraph) ToMermaidWithTaskRef

func (g *TaskGraph) ToMermaidWithTaskRef() string

ToMermaidWithTaskRef converts a TaskGraph to a mermaid graph with taskRefName

func (*TaskGraph) ToPlantUML

func (g *TaskGraph) ToPlantUML() string

ToPlantUML converts a TaskGraph to a PlantUML graph

func (*TaskGraph) ToPlantUMLWithTaskRef

func (g *TaskGraph) ToPlantUMLWithTaskRef() string

ToPlantUMLWithTaskRef converts a TaskGraph to a PlantUML graph with taskRefName

type TaskNode

type TaskNode struct {
	Name         string
	TaskRefName  string // Name of the kind: Task referenced by this task in the pipeline
	Dependencies []*TaskNode
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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