output

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package output renders API data as aligned tables, pretty JSON, or CSV.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) string

Bool renders yes/no.

func CSV

func CSV(w io.Writer, headers []string, rows [][]string) error

CSV writes headers + rows in RFC 4180 CSV.

func JSON

func JSON(w io.Writer, raw []byte) error

JSON pretty-prints a raw API response body.

func Num

func Num(v *float64) string

Num formats a nullable number without trailing zeros ("-" when absent).

func Price

func Price(v *float64) string

Price formats a nullable price with 2 decimals ("-" when absent).

func Table

func Table(w io.Writer, headers []string, rows [][]string)

Table renders rows in aligned columns.

func Truncate

func Truncate(s string, max int) string

Truncate shortens s to max runes, ending with … when cut.

Types

This section is empty.

Jump to

Keyboard shortcuts

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