output

package
v0.0.0-...-3feb698 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFormat = "table"
)

Variables

This section is empty.

Functions

func ValidFormats

func ValidFormats() []string

ValidFormats returns the list of valid formats for NewOutput

Types

type CSVOutput

type CSVOutput columnOutput

func (*CSVOutput) PrintProposals

func (o *CSVOutput) PrintProposals(proposals []*api.Proposal)

PrintProposals prins KEPs array in CSV format

type JSONOutput

type JSONOutput output

func (*JSONOutput) PrintProposals

func (o *JSONOutput) PrintProposals(proposals []*api.Proposal)

PrintProposals prints KEPs array in JSON format

type Output

type Output interface {
	PrintProposals([]*api.Proposal)
}

Output is capable of printing... well pretty much just KEPs, but if there is interest in printing other types in api, this could be the place

func NewOutput

func NewOutput(format string, out, err io.Writer) (Output, error)

NewOutput returns an Output of the given format that will write to the given out and err Writers, or return an err if the format isn't one of ValidFormats()

type PrintConfig

type PrintConfig interface {
	Title() string
	Value(*api.Proposal) string
}

PrintConfig defines how a given Proposal field should be formatted for columnar output (e.g. TableOutput, CSVOutput)

func DefaultPrintConfigs

func DefaultPrintConfigs(names ...string) []PrintConfig

type TableOutput

type TableOutput columnOutput

func (*TableOutput) PrintProposals

func (o *TableOutput) PrintProposals(proposals []*api.Proposal)

PrintProposals prints KEPs array in table format

type YAMLOutput

type YAMLOutput output

func (*YAMLOutput) PrintProposals

func (o *YAMLOutput) PrintProposals(proposals []*api.Proposal)

PrintProposals prints KEPs array in YAML format

Jump to

Keyboard shortcuts

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