output

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package output is the single output contract: data to stdout, human chatter to stderr, stable JSON, --format json|plain|tsv, --select projection, and --limit bounding. See contract.md §1 and §6.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format string
const (
	FormatJSON  Format = "json"
	FormatPlain Format = "plain"
	FormatTSV   Format = "tsv"
)

type Writer

type Writer struct {
	Stdout io.Writer
	Stderr io.Writer
	Format Format
	Color  bool
	Limit  int
	Select []string
}

Writer routes all command output. Data goes to Stdout; Info/Warn go to Stderr.

func (*Writer) Emit

func (w *Writer) Emit(v any) error

Emit renders a value to stdout per the active format, after applying --select and --limit.

func (*Writer) EmitJSON

func (w *Writer) EmitJSON(v any) error

EmitJSON forces JSON output regardless of --format (used by `schema`).

func (*Writer) Info

func (w *Writer) Info(format string, a ...any)

Info writes a human-facing message to stderr (keeps stdout parseable).

Jump to

Keyboard shortcuts

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