Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FormatFuncType ¶
FormatFunc is a function that generates the output format string for a TaskGraph
var FormatFunc FormatFuncType = func(graph *TaskGraph, format string, withTaskRef bool) (string, error) { switch strings.ToLower(format) { case "dot": if withTaskRef { return graph.ToDOTWithTaskRef().String(), nil } return graph.ToDOT().String(), nil case "puml": if withTaskRef { return graph.ToPlantUMLWithTaskRef(), nil } return graph.ToPlantUML(), nil case "mmd": if withTaskRef { return graph.ToMermaidWithTaskRef(), nil } return graph.ToMermaid(), nil default: return "", fmt.Errorf("Invalid output format: %s", format) } }
formatFunc generates the output format string for a TaskGraph based on the specified format
type TaskGraph ¶
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) ToDOTWithTaskRef ¶
ToDOTWithTaskRef converts a TaskGraph to a DOT graph
func (*TaskGraph) ToMermaidWithTaskRef ¶
ToMermaidWithTaskRef converts a TaskGraph to a mermaid graph with taskRefName
func (*TaskGraph) ToPlantUML ¶
ToPlantUML converts a TaskGraph to a PlantUML graph
func (*TaskGraph) ToPlantUMLWithTaskRef ¶
ToPlantUMLWithTaskRef converts a TaskGraph to a PlantUML graph with taskRefName