Documentation
¶
Overview ¶
Package render writes what commands produce: JSON for programs (design §5), and, from milestone 2, tables for people.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlignRight ¶
AlignRight pads the cells of the columns cols on the left, so they line up on their right edge, as amounts should. The header counts toward the width. tabwriter can only align every column one way; this does one at a time, before Table pads them all on the right.
func Fields ¶
Fields writes label and value pairs, one a line, values lined up: the layout `quantic stock` uses too, for `quantic auth status`.
func JSON ¶
JSON writes v as indented JSON followed by a newline. Indented because a person reads it too (piped to less, pasted in an issue); a program doesn't care either way. The trailing newline is what every Unix tool expects of a line of output, and what json.Encoder adds by itself.
HTML escaping is off: by default Go writes "AT&T" as "AT\u0026T", which is valid JSON and right inside an HTML page, and wrong in a terminal.
func Or ¶
Or returns *s, or "-" when s is nil or blank: how a table shows a value Quantic doesn't have. Runs of spaces inside s collapse to one, because some names come from exchanges padded to a fixed width.
Types ¶
This section is empty.