output

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintErrorText

func PrintErrorText(w io.Writer, o ErrorOptions) error

func PrintJson

func PrintJson(w io.Writer, v interface{}, f ...string) error

func PrintTable

func PrintTable(w io.Writer, v interface{}, f ...string) error

func PrintText

func PrintText(w io.Writer, v interface{}, o TextOptions, f ...string) error

Types

type ErrorOptions

type ErrorOptions struct {
	Format string
	Error  string
}

type Output

type Output struct {
	// contains filtered or unexported fields
}

func New

func New(o *Output, defaultType OutputType, defaultStringFormat, defaulErrorFormat string) *Output

func (*Output) ErrorFormat

func (o *Output) ErrorFormat() string

func (*Output) Set

func (o *Output) Set(v string) error

func (*Output) String

func (o *Output) String() string

func (*Output) StringFormat

func (o *Output) StringFormat() string

func (*Output) Type

func (o *Output) Type() string

type OutputType

type OutputType string
const (
	JsonType  OutputType = "json"
	TableType OutputType = "table"
	TextType  OutputType = "text"
)

type TextOptions

type TextOptions struct {
	Format string
	RPath  string
	HPath  string
	UPath  string
	APath  string
}

Jump to

Keyboard shortcuts

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