printer

package
v0.0.0-...-c7df71b Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Description string
	Value       interface{}
	ValueList   []interface{}
	ValueMap    map[string]interface{}
}

type Output

type Output struct {
	// OutputType   OutputType
	JsonOutput     bool
	CsvOutput      bool
	HtmlOutput     bool
	MarkDownOutput bool
	DebugOut       bool
	Messages       []*Message
	TableHeaders   []interface{}
	TableRows      [][]interface{}
}

Store OutputType for reference when posting messages

func New

func New(jsonOutput bool, csvOutput bool, htmlOutput bool, markDownOutput bool, debugOut bool) *Output

func (*Output) AddDebugMessage

func (o *Output) AddDebugMessage(description string, value interface{})

Debug message to user

func (*Output) AddDeferredListMessageRead

func (o *Output) AddDeferredListMessageRead(description string, value []interface{})

Adds a message that will not print until Close() is called, to print and align List of primitive Values (string, int, bool)

func (*Output) AddDeferredMapMessageRead

func (o *Output) AddDeferredMapMessageRead(description string, value map[string]interface{})

Adds a message that will not print until Close() is called, to print and align Map Value, string -> primitive (string, int, bool)

func (*Output) AddDeferredMessageRead

func (o *Output) AddDeferredMessageRead(description string, value interface{})

Adds a message that will not print until Close() is called, to print and align Single primitive Value (string, int, bool)

func (*Output) AddErrorMessage

func (o *Output) AddErrorMessage(description string, value interface{}, exit bool)

Error message to user

func (*Output) AddInfoMessage

func (o *Output) AddInfoMessage(value string)

Info Message to user

func (*Output) AddTableHeaders

func (o *Output) AddTableHeaders(headers ...interface{})

Add headers for table, used for a list of items

func (*Output) AddTableRows

func (o *Output) AddTableRows(rows ...interface{})

Add rows for at table, will be matched to headers set in AddTableHeaders, used for a list of items

func (*Output) AddUserInputMessage

func (o *Output) AddUserInputMessage(value string)

User Prompt Message to user

func (*Output) AddWarningMessage

func (o *Output) AddWarningMessage(value string)

Warning Message to user

func (*Output) Close

func (o *Output) Close()

Jump to

Keyboard shortcuts

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