output

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderError

func RenderError(errorMsg string, opts Options)

RenderError renders an error string.

func RenderInfo

func RenderInfo(infoMsg string, opts Options)

RenderInfo renders an info string.

func RenderJSON

func RenderJSON(data interface{}, opts Options) string

RenderJSON renders `data` as a JSON string.

func RenderOutput

func RenderOutput(data Table, opts Options) string

RenderOutput renders tabular data.

func RenderResult

func RenderResult(result Result, opts Options) string

RenderResult renders a result string with optional key/value data.

func RenderString added in v0.33.0

func RenderString(msg string, opts Options) string

RenderString renders a simple string with no extra formatting.

Types

type Data

type Data []string

Data .

type Options

type Options struct {
	Header    bool
	CSV       bool
	JSON      bool
	Pretty    bool
	Debug     bool
	Error     string
	MultiLine bool
}

Options .

type Result

type Result struct {
	ResultData map[string]interface{} `json:"data,omitempty"`
	Result     string                 `json:"result,omitempty"` // `success` or warning/error message
	Error      string                 `json:"error,omitempty"`
	Info       string                 `json:"info,omitempty"`
}

Result .

type Table

type Table struct {
	Header []string `json:"header"`
	Data   []Data   `json:"data"`
}

Table .

Jump to

Keyboard shortcuts

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