tree

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package tree provides tree visualization logic for workflow debugging.

Package tree provides tree visualization logic for workflow debugging. This handles the construction and traversal of the workflow call tree for rendering in the TUI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSubWorkflowChildren

func AddSubWorkflowChildren(node *TreeNode, subWF *workflow.Workflow, baseDepth int)

AddSubWorkflowChildren adds the calls from a subworkflow as children of the given node.

func AggregateStatus

func AggregateStatus(calls []workflow.Call) string

AggregateStatus determines the overall status from multiple calls.

func EarliestStart

func EarliestStart(calls []workflow.Call) time.Time

EarliestStart returns the earliest start time from a list of calls.

func LatestEnd

func LatestEnd(calls []workflow.Call) time.Time

LatestEnd returns the latest end time from a list of calls.

Types

type NodeType

type NodeType int

NodeType represents the type of node in the call tree.

const (
	NodeTypeWorkflow NodeType = iota
	NodeTypeCall
	NodeTypeSubWorkflow
	NodeTypeShard
)

type TreeNode

type TreeNode struct {
	ID            string
	Name          string
	Type          NodeType
	Status        string
	Duration      time.Duration
	Start         time.Time
	End           time.Time
	Expanded      bool
	Children      []*TreeNode
	Parent        *TreeNode
	CallData      *workflow.Call
	SubWorkflowID string
	Depth         int
}

TreeNode represents a node in the workflow call tree.

func BuildTree

func BuildTree(wf *workflow.Workflow) *TreeNode

BuildTree builds a tree structure from Workflow.

func GetVisibleNodes

func GetVisibleNodes(root *TreeNode) []*TreeNode

GetVisibleNodes returns a flat list of visible nodes for rendering.

Jump to

Keyboard shortcuts

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