cmd

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownOutputFormat = errors.New(`must be one of "table", "json", or "yaml"`)

Functions

func Output

func Output[K comparable, V any](out map[K]V, output OutputFormat, opts OutputOptions) (string, error)

Types

type OutputFormat

type OutputFormat string
const (
	OutputFormatTable OutputFormat = "table"
	OutputFormatJSON  OutputFormat = "json"
	OutputFormatYAML  OutputFormat = "yaml"
)

func (*OutputFormat) Set

func (e *OutputFormat) Set(v string) error

Set must have pointer receiver so it doesn't change the value of a copy

func (*OutputFormat) String

func (e *OutputFormat) String() string

func (*OutputFormat) Type

func (e *OutputFormat) Type() string

type OutputOptions

type OutputOptions struct {
	Key   string
	Value string
}

Jump to

Keyboard shortcuts

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