output

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 12 Imported by: 1 module, 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 output owns projection and embedded jq output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CellText

func CellText(s string) string

CellText keeps untrusted text in one terminal/TSV cell. JSON retains the original data; TSV follows the existing Python escaping contract.

func CompileJQ added in v0.9.0

func CompileJQ(expression string) (*gojq.Code, error)

CompileJQ lets commands reject a bad --jq expression before they send a request, so a mutation is never followed by an output failure.

func Discovery

func Discovery(w io.Writer, fields []string) error

func Fields

func Fields(raw string, available []string) ([]string, error)

func Grid

func Grid(w io.Writer, headers []string, rows [][]string) error

func JSON

func JSON(ctx context.Context, w io.Writer, record map[string]any, fields []string, expression string, terminal ...bool) error

func JSONList

func JSONList(ctx context.Context, w io.Writer, records []map[string]any, fields []string, expression string, terminal ...bool) error

func JSONValue added in v0.9.0

func JSONValue(ctx context.Context, w io.Writer, selected any, expression string, terminal ...bool) error

func KeyValues

func KeyValues(w io.Writer, pairs [][2]string) error

KeyValues preserves the insertion order and alignment of Python records.

func MultilineText

func MultilineText(s string) string

MultilineText preserves readable layout while escaping terminal instructions.

func Table

func Table(w io.Writer, headers []string, rows [][]string, piped bool, targets ...[][]string) error

Table optionally links terminal cells. Links are added only after escaping and measuring labels; untrusted values can never supply terminal controls.

func Text

func Text(s string) string

Text escapes external control characters while preserving readable content.

func UnsafeControl

func UnsafeControl(r rune) bool

UnsafeControl identifies external controls, including bidi formatting. Trusted ANSI styling and links are applied only after external values are escaped.

Types

This section is empty.

Jump to

Keyboard shortcuts

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