output

package
v2.11.3 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package output provides tree-structured rendering for DAG execution status.

Index

Constants

View Source
const (
	TreeBranch     = "├─"
	TreeLastBranch = "└─"
	TreePipe       = "│ "
	TreeSpace      = "  "
)

Tree drawing characters using Unicode box-drawing characters.

View Source
const (
	// DefaultMaxOutputLines is the default number of lines to show for stdout/stderr.
	DefaultMaxOutputLines = 50
	// DefaultMaxWidth is the maximum line width before wrapping.
	DefaultMaxWidth = 80
)

Variables

This section is empty.

Functions

func ReadLogFileTail

func ReadLogFileTail(path string, maxLines int) ([]string, int, error)

ReadLogFileTail reads the last N lines from a log file. It returns:

  • lines: the actual log lines (tail portion if truncated)
  • truncated: number of lines that were truncated from the beginning
  • err: any error encountered while reading

If maxLines is 0 or negative, all lines are returned. If the file doesn't exist or is empty, returns nil, 0, nil. Binary files are detected and return ["(binary data)"], 0, nil. Files larger than 10MB are skipped to prevent memory exhaustion.

func StatusText

func StatusText(status core.Status) string

StatusText returns human-readable status text for a DAG status.

Types

type Config

type Config struct {
	ColorEnabled   bool // Enable colored output using ANSI escape codes.
	ShowStdout     bool // Display stdout content in the tree.
	ShowStderr     bool // Display stderr content in the tree.
	MaxOutputLines int  // Limit stdout/stderr to last N lines (0 = unlimited).
	MaxWidth       int  // Maximum line width before wrapping (0 = no wrapping).
}

Config holds configuration for tree rendering.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration with sensible defaults.

type Renderer

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

Renderer renders DAG execution status as a tree structure.

func NewRenderer

func NewRenderer(config Config) *Renderer

NewRenderer creates a new tree renderer with the given configuration.

func (*Renderer) RenderDAGStatus

func (r *Renderer) RenderDAGStatus(dag *core.DAG, status *exec.DAGRunStatus) string

RenderDAGStatus renders the complete DAG status as a tree structure.

Jump to

Keyboard shortcuts

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