output

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package output renders API responses in one of the formats from BRO-486: json (default), yaml, jsonl, table — optionally filtered by --query (a small JSONPath subset).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HumanizeDates

func HumanizeDates(v interface{}) interface{}

HumanizeDates is the exported entry point for the same transformation Print applies — used by hand-written commands (e.g. `bron tx subscribe`) that build their own output pipelines but still want ISO dates by default.

func Print

func Print(v interface{}) error

Print renders v according to the global format/query.

func PrintJSON

func PrintJSON(v interface{}) error

PrintJSON is kept as an alias for callers that want JSON regardless of globals.

func SetCellMax

func SetCellMax(n int)

SetCellMax sets the per-cell character cap for table output. 0 disables truncation entirely (useful on wide terminals where full IDs / addresses matter more than alignment). Negative or unset values keep the default.

func SetColumns

func SetColumns(c string)

SetColumns selects which fields to render in --output table. Comma-separated list (e.g. "transactionId,status,createdAt"). Empty disables filtering.

func SetDateKeys

func SetDateKeys(keys map[string]bool)

SetDateKeys configures the set of property names whose values are epoch-milliseconds — populated at CLI startup from the OpenAPI spec by collecting leaves with `format: "date-time-millis"`. Output formatters humanize values for these keys to ISO-8601 UTC. Empty set disables humanization entirely.

func SetFormat

func SetFormat(f string)

SetFormat updates the global output format. Empty string is ignored.

func SetQuery

func SetQuery(q string)

SetQuery updates the global JSONPath query. Empty string disables filtering.

Types

This section is empty.

Jump to

Keyboard shortcuts

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