format

package
v0.32.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToValues

func ToValues(strings [][]string) [][]Value

func ValuesToStrings

func ValuesToStrings(sliceOfValues [][]Value) [][]string

Types

type Bool

type Bool bool

func (Bool) MarshalJSON

func (b Bool) MarshalJSON() ([]byte, error)

func (Bool) String

func (b Bool) String() string

type Float

type Float float64

func (Float) MarshalJSON

func (f Float) MarshalJSON() ([]byte, error)

func (Float) String

func (f Float) String() string

type Formatter

type Formatter interface {
	Details(rows [][]Value)
	Table(header []string, rows [][]Value)
}

func FormatterFromCommand

func FormatterFromCommand(cmd *cobra.Command) Formatter

type Int

type Int int

func (Int) MarshalJSON

func (i Int) MarshalJSON() ([]byte, error)

func (Int) String

func (i Int) String() string

type JSONFormatter

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

func (JSONFormatter) Details

func (j JSONFormatter) Details(rows [][]Value)

func (JSONFormatter) Table

func (j JSONFormatter) Table(header []string, rows [][]Value)

type MultiValue

type MultiValue []Value

func (MultiValue) MarshalJSON

func (m MultiValue) MarshalJSON() ([]byte, error)

func (MultiValue) String

func (m MultiValue) String() string

type String

type String string

func (String) MarshalJSON

func (s String) MarshalJSON() ([]byte, error)

func (String) String

func (s String) String() string

type TextFormatter

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

func (TextFormatter) Details

func (t TextFormatter) Details(rows [][]Value)

func (TextFormatter) Table

func (t TextFormatter) Table(header []string, rows [][]Value)

type Value

type Value interface {
	fmt.Stringer
	json.Marshaler
}

Jump to

Keyboard shortcuts

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