node

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT, MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package node implements the goroutine-safe tree node behind the interactive renderer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EchelonNode

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

EchelonNode is one tree node: title, spinner/status, duration, description lines, and children. All methods are goroutine-safe.

func NewEchelonNode

func NewEchelonNode(title string, config *config.InteractiveRendererConfig) *EchelonNode

NewEchelonNode creates a paused node with the neutral title color.

func StartNewEchelonNode

func StartNewEchelonNode(title string, config *config.InteractiveRendererConfig) *EchelonNode

StartNewEchelonNode creates a node and starts it immediately.

func (*EchelonNode) AddNewChild

func (node *EchelonNode) AddNewChild(child *EchelonNode)

AddNewChild attaches an existing child node.

func (*EchelonNode) AppendDescription

func (node *EchelonNode) AppendDescription(text string)

AppendDescription merges text into the description, joining the first new line onto the last existing one (streaming writes rarely end cleanly).

func (*EchelonNode) ClearAllChildren

func (node *EchelonNode) ClearAllChildren()

ClearAllChildren drops all child nodes.

func (*EchelonNode) ClearDescription

func (node *EchelonNode) ClearDescription()

ClearDescription drops all description lines.

func (*EchelonNode) Complete

func (node *EchelonNode) Complete()

Complete completes the node keeping its status glyph.

func (*EchelonNode) CompleteWithColor

func (node *EchelonNode) CompleteWithColor(status string, titleColor int)

CompleteWithColor completes the node with a status glyph and title color.

func (*EchelonNode) DescriptionLength

func (node *EchelonNode) DescriptionLength() int

DescriptionLength returns the description line count.

func (*EchelonNode) ExecutionDuration

func (node *EchelonNode) ExecutionDuration() time.Duration

ExecutionDuration returns how long the node ran (or has run so far).

func (*EchelonNode) FindOrCreateChild

func (node *EchelonNode) FindOrCreateChild(childTitle string) *EchelonNode

FindOrCreateChild returns the last child with the title, creating it first.

func (*EchelonNode) GetChildren

func (node *EchelonNode) GetChildren() []*EchelonNode

GetChildren returns the child nodes.

func (*EchelonNode) HasCompleted

func (node *EchelonNode) HasCompleted() bool

HasCompleted reports whether the node completed.

func (*EchelonNode) HasStarted

func (node *EchelonNode) HasStarted() bool

HasStarted reports whether the node started.

func (*EchelonNode) IsRunning

func (node *EchelonNode) IsRunning() bool

IsRunning reports whether the node started but not completed.

func (*EchelonNode) Render

func (node *EchelonNode) Render() []string

Render returns the node lines: fancy title, children, then the description tail (truncated with "..." when over the visible cap).

func (*EchelonNode) SetDescription

func (node *EchelonNode) SetDescription(description []string)

SetDescription replaces the description lines.

func (*EchelonNode) SetStatus

func (node *EchelonNode) SetStatus(text string)

SetStatus replaces the status glyph.

func (*EchelonNode) SetTitleColor

func (node *EchelonNode) SetTitleColor(ansiColor int)

SetTitleColor replaces the ANSI title color.

func (*EchelonNode) SetVisibleDescriptionLines

func (node *EchelonNode) SetVisibleDescriptionLines(count int)

SetVisibleDescriptionLines caps rendered description lines.

func (*EchelonNode) Start

func (node *EchelonNode) Start()

Start marks the node started (once).

func (*EchelonNode) StartNewChild

func (node *EchelonNode) StartNewChild(childName string) *EchelonNode

StartNewChild creates, starts, and attaches a child node.

func (*EchelonNode) UpdateConfig

func (node *EchelonNode) UpdateConfig(config *config.InteractiveRendererConfig)

UpdateConfig replaces the node config.

func (*EchelonNode) UpdateTitle

func (node *EchelonNode) UpdateTitle(text string)

UpdateTitle replaces the node title.

func (*EchelonNode) WaitCompletion

func (node *EchelonNode) WaitCompletion()

WaitCompletion blocks until the node completes.

Jump to

Keyboard shortcuts

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