Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field[T any] struct { Name string Header string Extract func(T) any // Aliases are alternative names accepted by --json; they do not appear in // the valid-fields error list so the canonical name is always preferred. Aliases []string // JSONOnly marks a field that is available via --json but omitted from the // default table output (e.g. UUID, webURL columns that clutter the TTY view). JSONOnly bool // ColorFunc, if set, is applied to the rendered string in TTY table mode // only. It is intentionally NOT applied to JSON output, where consumers // expect raw values, nor in non-TTY table mode (piped output). ColorFunc func(string) string }
Field describes one output column and JSON key for type T.
type Printer ¶
type Printer[T any] struct { // contains filtered or unexported fields }
Printer renders a slice of T in the correct output mode.
func (*Printer[T]) SetSingleItem ¶
func (p *Printer[T]) SetSingleItem()
SetSingleItem marks the printer to emit a JSON object instead of an array.
Click to show internal directories.
Click to hide internal directories.