output

package
v0.0.0-...-544c3f1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JSON = "json"
	YAML = "yaml"
	YML  = "yml"
	TOML = "toml"
)
View Source
const WRITE_SUCCESS = "File successfully written to: %s"

Variables

This section is empty.

Functions

func Print

func Print(out TypeOutputInterface) error

Types

type DescribeOutput

type DescribeOutput struct {
	GeneralOutput `json:"-" yaml:"-" toml:"-"`
	Fields        map[string]string
	Values        interface{}
	Field         string // Used for large character values like codes or scripts that break the table.
}

func (*DescribeOutput) Format

func (d *DescribeOutput) Format() (bool, error)

func (*DescribeOutput) Output

func (c *DescribeOutput) Output()

type ErrorOutput

type ErrorOutput struct {
	GeneralOutput `json:"-" yaml:"-" toml:"-"`
	Err           error `json:"error"`
}

func (*ErrorOutput) Format

func (e *ErrorOutput) Format() (bool, error)

func (*ErrorOutput) Output

func (e *ErrorOutput) Output()

type GeneralOutput

type GeneralOutput struct {
	Msg   string    `json:"message" yaml:"message" toml:"message"`
	Out   io.Writer `json:"-" yaml:"-" toml:"-"`
	Flags cmdutil.Flags
}

func (*GeneralOutput) Format

func (g *GeneralOutput) Format() (bool, error)

func (*GeneralOutput) Output

func (g *GeneralOutput) Output()

type ListOutput

type ListOutput struct {
	GeneralOutput `json:"-" yaml:"-" toml:"-"`
	Columns       []string   `json:"columns" yaml:"columns" toml:"columns"`
	Lines         [][]string `json:"lines" yaml:"lines" toml:"lines"`
}

func (*ListOutput) Format

func (l *ListOutput) Format() (bool, error)

func (*ListOutput) Output

func (c *ListOutput) Output()

type Output

type Output struct {
	Output TypeOutputInterface
}

type TypeOutputInterface

type TypeOutputInterface interface {
	Output()
	Format() (bool, error)
}

Jump to

Keyboard shortcuts

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