output

package
v0.0.0-...-cc35533 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const INDENT string = "  "

INDENT is the indentation passed to json.MarshalIndent

Variables

View Source
var ErrArgsFlagPrefix = "Argument error:"

ErrArgsFlagPrefix is the prefix for when a flag's argument is invalid.

View Source
var ErrFlagFormattingPrefix = "Invalid flag formatting:"

ErrFlagFormatting is the prefix for when a flag's format is invalid.

View Source
var ErrMissingFlagPrefix = "Missing flag:"

ErrMissingFlagPrefix is the prefix for when a required flag is missing.

Functions

func DefaultJSON

func DefaultJSON(w io.Writer, i interface{})

func ListCSV

func ListCSV(writer io.Writer, many []map[string]interface{}, keys []string, noHeader bool)

func ListJSON

func ListJSON(w io.Writer, maps []map[string]interface{}, keys []string)

func ListTable

func ListTable(writer io.Writer, many []map[string]interface{}, keys []string, noHeader bool)

ListTable writes a table composed of keys as the header with values from many

func MetadataCSV

func MetadataCSV(writer io.Writer, m map[string]interface{}, keys []string, noHeader bool)

func MetadataJSON

func MetadataJSON(w io.Writer, m map[string]interface{}, keys []string)

func MetadataTable

func MetadataTable(writer io.Writer, m map[string]interface{}, keys []string)

MetadataTable writes a table to the writer composed of keys on the left and the associated metadata on the right column from m

Types

type ErrArgs

type ErrArgs struct {
	Msg string
}

ErrArgs is used when a flag's arguments are invalid.

func (ErrArgs) Error

func (e ErrArgs) Error() string

type ErrFlagFormatting

type ErrFlagFormatting struct {
	Msg string
}

ErrFlagFormatting is used when a flag's format is invalid.

func (ErrFlagFormatting) Error

func (e ErrFlagFormatting) Error() string

type ErrMissingFlag

type ErrMissingFlag struct {
	Msg string
}

ErrMissingFlag is used when a user doesn't provide a required flag.

func (ErrMissingFlag) Error

func (e ErrMissingFlag) Error() string

Jump to

Keyboard shortcuts

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