printer

package
v0.38.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bold

func Bold(msg interface{}) string

Bold returns a string formatted with bold.

func BoldGreen

func BoldGreen(msg interface{}) string

BoldGreen returns a string formatted with green and bold.

func BoldRed

func BoldRed(msg interface{}) string

BoldRed returns a string formatted with red and bold.

func BoldWhite

func BoldWhite(msg interface{}) string

BoldWhite returns a string formatted with white and bold.

func BoldYellow

func BoldYellow(msg interface{}) string

BoldYellow returns a string formatted with yellow and bold.

Types

type Format

type Format int
const (
	Human Format = iota
	JSON
)

func NewFormatValue

func NewFormatValue(val Format, p *Format) *Format

func (*Format) Type

func (f *Format) Type() string

type Printer

type Printer struct {
	// contains filtered or unexported fields
}

func NewPrinter

func NewPrinter(format *Format) *Printer

func (*Printer) Format

func (p *Printer) Format() Format

Format returns the format that was set for this printer

func (*Printer) Print

func (p *Printer) Print(i ...interface{})

func (*Printer) PrintBold

func (p *Printer) PrintBold(str string)

func (*Printer) PrintJSON

func (p *Printer) PrintJSON(v interface{}) error

func (*Printer) PrintResource

func (p *Printer) PrintResource(v interface{}) error

func (*Printer) Printf

func (p *Printer) Printf(format string, i ...interface{})

func (*Printer) Println

func (p *Printer) Println(i ...interface{})

func (*Printer) PrintlnError

func (p *Printer) PrintlnError(str string)

func (*Printer) PrintlnInfo

func (p *Printer) PrintlnInfo(str string)

func (*Printer) PrintlnSuccess

func (p *Printer) PrintlnSuccess(str string)

func (*Printer) PrintlnWarn

func (p *Printer) PrintlnWarn(str string)

func (*Printer) SetHumanOutput

func (p *Printer) SetHumanOutput(out io.Writer)

SetHumanOutput sets the output for human readable messages.

func (*Printer) SetResourceOutput

func (p *Printer) SetResourceOutput(out io.Writer)

SetResourceOutput sets the output for pringing resources via PrintResource.

Jump to

Keyboard shortcuts

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