output

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(data interface{})

JSON prints data as indented JSON to stdout.

func JoinStrings

func JoinStrings(items []string, sep string) string

JoinStrings joins a slice of strings.

func KeyValue

func KeyValue(pairs [][2]string)

KeyValue renders key-value pairs in a simple format.

func Print

func Print(data interface{}, tableFn func(data interface{}))

Print outputs data as JSON or table based on the --json flag.

func PrintRaw

func PrintRaw(body []byte, tableFn func(data map[string]interface{}))

PrintRaw prints the raw byte body as JSON (for untyped API responses).

func StringOrEmpty

func StringOrEmpty(v interface{}) string

StringOrEmpty returns the string value of an interface or empty string.

func Success

func Success(msg string)

Success prints a success message.

func Successf

func Successf(format string, args ...interface{})

Successf prints a formatted success message.

func Table

func Table(headers []string, rows [][]string)

Table renders data as a clean ASCII table.

func Truncate

func Truncate(s string, maxLen int) string

Truncate shortens a string to maxLen with ellipsis.

Types

This section is empty.

Jump to

Keyboard shortcuts

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