print

package
v2.0.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Printer

type Printer struct {
	Output       io.Writer
	OutputFormat string
}

Printer handles formatted output of different types of data

func NewPrinter

func NewPrinter(cmd *cobra.Command) (*Printer, error)

NewPrinter creates a new Printer instance with default stdout

func (*Printer) PrintBytes

func (p *Printer) PrintBytes(out []byte) error

PrintBytes prints and formats bytes

func (*Printer) PrintRaw

func (p *Printer) PrintRaw(toPrint json.RawMessage) error

PrintRaw prints raw JSON message without marshaling

func (*Printer) PrintString

func (p *Printer) PrintString(str string) error

PrintString prints the raw string

Jump to

Keyboard shortcuts

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