printer

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 8 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlueText

func BlueText(text string) string

func CyanText

func CyanText(text string) string

func GreenText

func GreenText(text string) string

func MagentaText

func MagentaText(text string) string

func RedText

func RedText(text string) string

func YellowText

func YellowText(text string) string

Types

type DisplayField

type DisplayField struct {
	DisplayName string
	ColumnTag   string
	Value       func() string
}

type JSON

type JSON interface {
	PrintProtoObject(msg proto.Message) error
	PrintProtoObjects(msgs []proto.Message) error
}

JSON is a writer to display any proto object in JSON format.

func NewJSONPrinter

func NewJSONPrinter() JSON

type PlainText

type PlainText interface {
	PrintTable(headers []string, rows [][]string, opts ...TablePrinterOption)
	PrintDisplayField(field DisplayField)
	PrintDisplayFieldWithIndent(field DisplayField)
	PrintKeyValue(key, value string)
	PrintKeyValueWithIndent(key, value string)
	PrintLineSeparator()
	PrintEmptyLine()
	PrintHeader(value string)
	PrintError(message string)
	PrintWarning(value string)
	PrintSuccess(value string)
	SeekConfirmation(message string) bool
	PrintInJSONFormat(obj interface{}) error
}

PlainText is a writer to display compute broker service entities in plain text format.

func NewPlainTextPrinter

func NewPlainTextPrinter() PlainText

type TablePrinterOption

type TablePrinterOption func(*tablePrinterOptions)

func WithAlignLeft

func WithAlignLeft() TablePrinterOption

func WithHideTotal

func WithHideTotal() TablePrinterOption

func WithRowSeparator

func WithRowSeparator() TablePrinterOption

Jump to

Keyboard shortcuts

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