formatter

package
v0.0.0-...-e5703c2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatJSON  = "json"
	FormatTable = "table"
	FormatGoTpl = "gotemplate"
)

Variables

View Source
var SupportedFormats = []string{FormatJSON, FormatTable, FormatGoTpl}

SupportedFormats is a slice of all supported format types

Functions

This section is empty.

Types

type Formatter

type Formatter struct {
	Format string
	Output string
	CMD    *cobra.Command
}

func New

func New(format string, output string, cmd *cobra.Command) (*Formatter, error)

func (*Formatter) PrintEventDescriptionJSON

func (f *Formatter) PrintEventDescriptionJSON(description *pb.GetEventDefinitionsResponse)

func (*Formatter) PrintEventDescriptionTable

func (f *Formatter) PrintEventDescriptionTable(response *pb.GetEventDefinitionsResponse) *table.Table

func (*Formatter) PrintEventListJSON

func (f *Formatter) PrintEventListJSON(list *pb.GetEventDefinitionsResponse)

func (*Formatter) PrintEventListTable

func (f *Formatter) PrintEventListTable(response *pb.GetEventDefinitionsResponse) *table.Table

func (*Formatter) PrintSteamTableHeaders

func (f *Formatter) PrintSteamTableHeaders()

func (*Formatter) PrintStreamJSON

func (f *Formatter) PrintStreamJSON(event *pb.Event)

PrintJSON prints an event in JSON format

func (*Formatter) PrintStreamTableRow

func (f *Formatter) PrintStreamTableRow(event *pb.Event)

Jump to

Keyboard shortcuts

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