output

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package output renders command results as a human table or as machine JSON or YAML, selected by the --format flag. Agents pass --format json for a stable, parseable surface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Emit

func Emit(format string, v interface{}, tableFn func() Table) error

Emit writes v in the requested format. For "table" it calls tableFn to build the columns; for "json"/"yaml" it marshals v directly. tableFn may be nil when only structured output makes sense.

func Str

func Str(m map[string]interface{}, key string) string

Str returns a string field from a generic record, or "" if absent.

Types

type Table

type Table struct {
	Headers []string
	Rows    [][]string
}

Table is a set of column headers and rows.

Jump to

Keyboard shortcuts

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