formatter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format string
const (
	TextFormat  Format = "text"
	TableFormat Format = "table"
	JsonFormat  Format = "json"
	YamlFormat  Format = "yaml"
)

func (Format) Validate

func (f Format) Validate() error

type Formatter

type Formatter interface {
	Write(interface{})
}

func NewFormatter

func NewFormatter(format Format, output io.Writer) Formatter

func NewJson

func NewJson(output io.Writer) Formatter

func NewTable

func NewTable(output io.Writer) Formatter

func NewText

func NewText(output io.Writer) Formatter

func NewYaml

func NewYaml(output io.Writer) Formatter

type Json

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

func (*Json) Write

func (f *Json) Write(o interface{})

type ListResult

type ListResult interface {
	BriefItems() reflect.Value
}

ListResult only applies for table formatter

type Table

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

func (*Table) Write

func (f *Table) Write(o interface{})

type Text

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

func (*Text) Write

func (f *Text) Write(o interface{})

type Yaml

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

func (*Yaml) Write

func (f *Yaml) Write(o interface{})

Jump to

Keyboard shortcuts

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