render

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatTable = "table"
	FormatTSV   = "tsv"
	FormatJSON  = "json"
)

FormatTable, FormatTSV, FormatJSON are the supported --format values.

Variables

This section is empty.

Functions

func Render

func Render(out io.Writer, r Result, format string) error

Render writes the result to out in the named format. An empty format string auto-detects (table when out is a terminal, TSV otherwise).

func WriteTableBody

func WriteTableBody(out io.Writer, cols []string, rows []map[string]any) error

WriteTableBody renders the header + separator + data rows, but no footer. Used both by renderTable (which appends the row count) and by Phase F write previews (which append their own "... N more" line).

Types

type Result

type Result struct {
	Columns []string
	Rows    []map[string]any
}

Result is a column-ordered tabular result ready for rendering. Cells hold the raw values returned by Graph (string, float64, bool, nil, ...) so the JSON renderer can preserve types; the table and TSV renderers stringify on the way out.

Jump to

Keyboard shortcuts

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