Documentation
¶
Index ¶
- func CountLines(root *Node) int
- func SortByOrder(jobSet map[string]bool, orderList []string) []string
- func SortJobsByDepth(jobNames []string) []string
- type Builder
- type Display
- type ExecutionTree
- type Node
- func BuildFromPipeline(pipeline *model.Pipeline, ...) (*Node, error)
- func NewCmdNode(name string) *Node
- func NewJobNode(name string, nested bool) *Node
- func NewNode(name string) *Node
- func NewPendingStepNode(name string, deferred, summarize bool) *Node
- func NewStepNode(name string, deferred bool) *Node
- func (n *Node) AddChild(child *Node)
- func (n *Node) AddChildren(children ...*Node)
- func (n *Node) GetChildren() []*Node
- func (n *Node) HasChildren() bool
- func (n *Node) Label() string
- func (n *Node) SetDuration(duration float64)
- func (n *Node) SetIf(condition string)
- func (n *Node) SetOutput(lines []string)
- func (n *Node) SetStartOffset(offset float64)
- func (n *Node) SetStatus(status Status)
- func (n *Node) StatusColor() string
- type Renderer
- type Status
- type TreeNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountLines ¶
CountLines returns the number of lines the tree will render.
func SortByOrder ¶
SortByOrder returns the job names from the set in the order specified by orderList. Jobs in the set that are not in orderList are appended at the end.
func SortJobsByDepth ¶
SortJobsByDepth sorts job names by ':' depth, then alphabetically. Depth is determined by the count of ':' separators in the job name.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder constructs tree nodes from pipeline data.
func NewBuilder ¶
NewBuilder creates a new tree builder.
func (*Builder) AddJobWithSummary ¶
AddJobWithSummary adds a job node to the tree with summarization enabled.
func (*Builder) AddJobWithoutSteps ¶
AddJobWithoutSteps adds a job node to the tree without steps (steps should be added manually afterwards).
type Display ¶
type Display struct {
// contains filtered or unexported fields
}
Display manages in-place tree rendering with ANSI cursor control.
func (*Display) IsTerminal ¶
IsTerminal returns whether stdout is a TTY.
func (*Display) RenderStatic ¶
RenderStatic displays a static tree view (for list).
type ExecutionTree ¶
type ExecutionTree struct {
Root *TreeNode
// contains filtered or unexported fields
}
ExecutionTree holds the entire execution tree.
func NewExecutionTree ¶
func NewExecutionTree(pipelineName string) *ExecutionTree
NewExecutionTree creates a new execution tree with a root node.
func (*ExecutionTree) AddJob ¶
func (et *ExecutionTree) AddJob(job *model.Job) *TreeNode
AddJob adds a job node to the tree.
func (*ExecutionTree) AddJobWithDeps ¶
func (et *ExecutionTree) AddJobWithDeps(jobName string, deps []string) *TreeNode
AddJobWithDeps adds a job node to the tree with dependencies.
func (*ExecutionTree) CountLines ¶
func (et *ExecutionTree) CountLines() int
CountLines returns the number of lines the tree will render.
func (*ExecutionTree) RenderTree ¶
func (et *ExecutionTree) RenderTree() string
RenderTree renders the entire tree to a string (live rendering).
type Node ¶
type Node struct {
Name string
ID string // Unique identifier (e.g., "job.steps.0", "job.steps.1" for iterations)
Status Status
CreatedAt time.Time
UpdatedAt time.Time
StartOffset float64 // Seconds offset from run start
Duration float64 // Duration in seconds
If string // Condition that was evaluated (for conditional steps)
Children []*Node
Dependencies []string
Deferred bool
Summarize bool
Output []string // Multi-line output from command execution
// contains filtered or unexported fields
}
Node represents a node in the tree (job, step, or iteration).
func BuildFromPipeline ¶
func BuildFromPipeline(pipeline *model.Pipeline, resolveDeps func(map[string]*model.Job, string) ([]string, error)) (*Node, error)
BuildFromPipeline constructs a complete tree from a pipeline. Returns the root node ready to be rendered.
func NewCmdNode ¶ added in v0.2.4
NewCmdNode creates a new command node as a child of a step.
func NewJobNode ¶
NewJobNode creates a new job node.
func NewPendingStepNode ¶ added in v0.2.4
NewPendingStepNode creates a new step node with pending status.
func NewStepNode ¶
NewStepNode creates a new step node.
func (*Node) AddChildren ¶
AddChildren adds multiple child nodes.
func (*Node) GetChildren ¶
GetChildren returns a copy of the children slice (thread-safe).
func (*Node) HasChildren ¶
HasChildren returns true or false if the node has children.
func (*Node) SetDuration ¶ added in v0.2.4
SetDuration sets the duration in seconds.
func (*Node) SetStartOffset ¶ added in v0.2.4
SetStartOffset sets the start offset from run start.
func (*Node) StatusColor ¶
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer handles rendering of tree nodes to strings with proper formatting.
func (*Renderer) RenderStatic ¶
RenderStatic renders a static tree (for list views) without spinners.
type Status ¶
type Status int
Status represents the execution status of a node.
const ( StatusPending Status = iota StatusRunning StatusPassed StatusFailed StatusSkipped StatusConditional )
Status constants.
type TreeNode ¶
type TreeNode struct {
*Node
// contains filtered or unexported fields
}
TreeNode represents a node in the execution tree (backward compatibility).
func (*TreeNode) AddStepDeferred ¶
AddStepDeferred adds a deferred step node to a job.
func (*TreeNode) GetChildren ¶
GetChildren returns the children of a node.