Help us shape the future of Go! Take the 2026 Go Developer Survey

render

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package render turns a (masked) result into the text an agent sees: TSV or JSON, within the profile's row, cell and output caps. Control and bidirectional characters are escaped, invalid UTF-8 is replaced, NULL is "NULL" (null in JSON), binary values are "<bytes:N>" and times ISO 8601.

Cells are cut while they are converted, so a huge value never costs more than its cap in output.

Index

Constants

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

Formats.

Variables

This section is empty.

Functions

func Render

func Render(w io.Writer, res engine.Result, l config.Limits, format string) error

Render writes res to w in format "tsv" (the default when empty) or "json". Limits that are zero or negative take the non-production defaults. Rows beyond MaxRows are dropped and reported as truncated; rows that would push the output past MaxOutputBytes are dropped with a marker.

Types

type Table added in v0.3.0

type Table struct {
	Header []string
	Rows   [][]string
	Footer []string
}

Table is the TSV rendering of a result split into cells, with the same caps as Render: the header labels, the rows shown and the lines after them (cut marker, row count).

func TSVTable added in v0.3.0

func TSVTable(res engine.Result, l config.Limits) Table

TSVTable is what Render writes in format tsv for a result with columns, before the cells are joined.

Jump to

Keyboard shortcuts

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