Documentation
¶
Index ¶
- Constants
- func PrintError(wr io.Writer, err error)
- func PrintFormat(wr io.Writer, outputFormat Format, encodedObject []byte, ...) error
- func PrintMessage(wr io.Writer, format string, a ...interface{})
- func PrintParameters(parameters map[string]interface{}) string
- func PrintServiceManagerObject(wr io.Writer, outputFormat Format, object types.ServiceManagerObject)
- func PrintTable(wr io.Writer, data *types.TableData)
- func Println(wr io.Writer)
- type Format
- type JSONPrinter
- type Printer
- type YAMLPrinter
Constants ¶
View Source
const ( // FormatText const for text output format FormatText = iota // FormatJSON const for json output format FormatJSON // FormatYAML const for yaml output format FormatYAML // FormatUnknown const for unknown output format FormatUnknown )
Variables ¶
This section is empty.
Functions ¶
func PrintFormat ¶ added in v1.5.0
func PrintFormat(wr io.Writer, outputFormat Format, encodedObject []byte, converter converterFunc) error
PrintFormat prints the object in the provided format if possible
func PrintMessage ¶
PrintMessage prints a message.
func PrintParameters ¶ added in v1.10.7
PrintParameters convert map to string
func PrintServiceManagerObject ¶
func PrintServiceManagerObject(wr io.Writer, outputFormat Format, object types.ServiceManagerObject)
PrintServiceManagerObject should be used for printing SM objects in different formats
func PrintTable ¶
PrintTable prints in table format
Types ¶
type JSONPrinter ¶
type JSONPrinter struct{}
JSONPrinter implements Printer interface and outputs in JSON format
func (*JSONPrinter) Print ¶
func (p *JSONPrinter) Print(wr io.Writer, data interface{})
Print prints in json format
type Printer ¶
type Printer interface { // Print is executed with writer and data to be printed Print(io.Writer, interface{}) }
Printer should be implemented for different output formats
type YAMLPrinter ¶
type YAMLPrinter struct{}
YAMLPrinter implements Printer interface and outputs in YAML format
func (*YAMLPrinter) Print ¶
func (p *YAMLPrinter) Print(wr io.Writer, data interface{})
Print prints in yaml format
Click to show internal directories.
Click to hide internal directories.