output

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDuration

func FormatDuration(ms *int64) string

FormatDuration formats milliseconds as human-readable duration.

func OutputJSON

func OutputJSON(data any, filePath string)

OutputJSON writes data as indented JSON to stdout or a file. If filePath is non-empty, writes to file and prints status to stderr.

func OutputJSONL

func OutputJSONL(items []map[string]any, filePath string)

OutputJSONL writes items as JSONL (one JSON object per line).

func OutputTable

func OutputTable(columns []string, rows [][]string, title string)

OutputTable prints a table to stdout using tablewriter.

func OutputTree

func OutputTree(runs []RunTreeData, rootID string)

OutputTree prints a trace hierarchy tree.

func PrintError

func PrintError(msg string)

PrintError prints a JSON error to stderr.

func PrintOutput

func PrintOutput(data any, format string, filePath string)

PrintOutput dispatches to JSON or pretty output.

func PrintRunsTable

func PrintRunsTable(w io.Writer, runs []map[string]any, includeMetadata bool, title string)

PrintRunsTable prints a table of runs in pretty format.

Types

type RunTreeData

type RunTreeData struct {
	ID          string
	ParentRunID string
	Name        string
	RunType     string
	DurationMs  *int64
	HasError    bool
}

RunTreeData holds the data needed for tree rendering.

Jump to

Keyboard shortcuts

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