printer

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package printer provides utilities for printing standard structures from api in convenient formats

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustRegisterOutputFormatFlags added in v0.9.0

func MustRegisterOutputFormatFlags(
	cmd *cobra.Command,
	outputFormat, fieldSeparator, recordSeparator *string,
)

Types

type Format

type Format string

Format represents supported printing outputs

const (
	YAMLFormat Format = "yaml"
	JSONFormat Format = "json"
	CSVFormat  Format = "csv"
)

All supported output formats by a Printer

type Printer

type Printer interface {
	Print(interface{}) error
}

Printer represents generic printer for cli

func New

func New(out io.Writer, format Format, fieldSeparator, recordSeparator string) (Printer, error)

New returns an instance of a proper printer based on format parameter

Jump to

Keyboard shortcuts

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