printer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorStatus

func ColorStatus(_ int, status string) (color.Color, bool)

ColorStatus colorizes the status based on status texts

func InitColorTheme

func InitColorTheme()

Types

type ColorPrinter

type ColorPrinter struct {
	Type string
}

func (*ColorPrinter) Print

func (cp *ColorPrinter) Print(buf string, w io.Writer)

type CustomPrinter

type CustomPrinter struct {
	ColorPicker func(line string) color.Color
}

CustomPrinter prints data depending on custom func

func (*CustomPrinter) Print

func (cp *CustomPrinter) Print(buf string, w io.Writer)

type JsonPrinter

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

func NewJsonPrinter

func NewJsonPrinter(jsonObj interface{}) *JsonPrinter

func (*JsonPrinter) Print

func (jp *JsonPrinter) Print(buf string, w io.Writer)

type PlainPrinter

type PlainPrinter struct {
}

func (*PlainPrinter) Print

func (pp *PlainPrinter) Print(buf string, w io.Writer)

type Printer

type Printer interface {
	Print(buf string, w io.Writer)
}

Printer reads from r and writes to w

type SingleColorPrinter

type SingleColorPrinter struct {
	Color color.Color
}

func (*SingleColorPrinter) Print

func (scp *SingleColorPrinter) Print(buf string, w io.Writer)

type TablePrinter

type TablePrinter struct {
	ColorPicker func(index int, column string) (color.Color, bool)
	// contains filtered or unexported fields
}

func NewTablePrinter

func NewTablePrinter(colorPicker func(int, string) (color.Color, bool)) *TablePrinter

func (*TablePrinter) Print

func (tp *TablePrinter) Print(buf string, w io.Writer)

type YamlPrinter

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

func NewYamlPrinter

func NewYamlPrinter() *YamlPrinter

func (*YamlPrinter) Print

func (yp *YamlPrinter) Print(buf string, w io.Writer)

Jump to

Keyboard shortcuts

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