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

render

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 5 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. It is lockkit's table renderer over a locksql result: 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.

Index

Constants

View Source
const (
	FormatTSV  = krender.FormatTSV
	FormatJSON = krender.FormatJSON
)

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 = krender.Cells

Table is the TSV rendering of a result split into cells: 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