output

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 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 .

func RenderInfo

func RenderInfo(infoMsg string, opts Options)

RenderInfo .

func RenderJSON

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

RenderJSON .

func RenderOutput

func RenderOutput(data Table, opts Options) string

RenderOutput .

func RenderResult

func RenderResult(result Result, opts Options) string

RenderResult .

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"`
	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