Documentation
¶
Overview ¶
Package output renders LinkedIn API JSON in table/json/yaml/csv/id. One renderer serves every command, driven by JSON normalization: an object becomes one row, an array of objects becomes many, nested fields flatten to dotted keys. Output is deterministic (preferred-key order then alphabetical) and pipe-clean (notes go to stderr) per the cliwright standard.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Render ¶
func Render(data json.RawMessage, opts Options) error
Render writes data in the requested format. data is the raw API response JSON.
func SanitizeTerminal ¶
SanitizeTerminal strips ANSI escape sequences and control characters from text that originated in the API (contact names, error bodies, labels) before it is printed to a human terminal. Without this, a crafted value like a contact named "\x1b]0;pwned\a" could rewrite the terminal title, move the cursor, or inject color — a real terminal-escape injection. Machine formats (json/yaml/csv) are left faithful; only the human table view and error output pass through here. Ported from the fleet-standard SanitizeText, which handles this and linkedin reuses verbatim.
Types ¶
type Options ¶
type Options struct {
Format Format
Columns []string // explicit column selection (overrides the preferred order)
NoColor bool
Quiet bool
JQ string // optional gojq expression applied before rendering
MaxCols int // cap auto-detected columns (default 10)
Out io.Writer
Err io.Writer
}
Options configure a single Render call.