printer

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorPrinter

type ColorPrinter struct {
	Success   *color.Color
	SuccessBg *color.Color
	Warning   *color.Color
	WarningBg *color.Color
	Failure   *color.Color
	FailureBg *color.Color
	Highlight *color.Color
	Faint     *color.Color
}

ColorPrinter 颜色输出

type Printer

type Printer struct {
	Writer io.Writer
	Colors ColorPrinter
}

Printer 输出器

func NewPrinter

func NewPrinter(writer io.Writer) *Printer

NewPrinter 创建 printer

func (*Printer) FailureBgPrint

func (p *Printer) FailureBgPrint(format string, a ...interface{}) string

FailureBgPrint 带有背景色的失败输出

func (*Printer) FailurePrint

func (p *Printer) FailurePrint(format string, a ...interface{}) string

FailurePrint 失败的输出

func (*Printer) HighlightPrint

func (p *Printer) HighlightPrint(format string, a ...interface{}) string

HighlightPrint 高亮输出

func (*Printer) Print

func (p *Printer) Print(content string, times int)

Print 输出到 writer, times 用以 tab 空行

func (*Printer) SuccessBgPrint

func (p *Printer) SuccessBgPrint(format string, a ...interface{}) string

SuccessBgPrint 带有背景色的输出

func (*Printer) SuccessPrint

func (p *Printer) SuccessPrint(format string, a ...interface{}) string

SuccessPrint 成功输出

func (*Printer) WarningBgPrint

func (p *Printer) WarningBgPrint(format string, a ...interface{}) string

WarningBgPrint 带有背景的警告输出

func (*Printer) WarningPrint

func (p *Printer) WarningPrint(format string, a ...interface{}) string

WarningPrint 警告输出

Jump to

Keyboard shortcuts

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