Documentation
¶
Overview ¶
Package output handles rendering CLI results in multiple formats.
Index ¶
- func DimText(s string, noColor bool) string
- func GreenText(s string, noColor bool) string
- func PrintQueryResult(w io.Writer, format Format, data []byte, noColor bool) error
- func PrintRawJSON(w io.Writer, v any) error
- func PrintSingle(w io.Writer, format Format, data map[string]string, noColor bool) error
- func PrintStructured(w io.Writer, format Format, headers []string, rows [][]string, noColor bool) error
- func ServerFormat(f Format) string
- func WarnText(s string, noColor bool) string
- type Format
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintQueryResult ¶
PrintQueryResult renders query results to the writer. For table format, it parses the JSON and renders a styled table. For json/csv/markdown, it writes the raw server response.
func PrintRawJSON ¶
PrintRawJSON prints a pre-formed JSON value with indentation.
func PrintSingle ¶
PrintSingle renders a single object as JSON or key-value pairs.
func PrintStructured ¶
func PrintStructured(w io.Writer, format Format, headers []string, rows [][]string, noColor bool) error
PrintStructured renders non-query data (projects, orgs, health, etc.) in the given format.
func ServerFormat ¶
ServerFormat maps a CLI output format to the server's format parameter.
Types ¶
type Format ¶
type Format string
Format represents an output format.
func ResolveFormat ¶
ResolveFormat resolves "auto" to a concrete format.
Click to show internal directories.
Click to hide internal directories.