output

package
v0.0.0-...-0031c6d Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2018 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Emit

func Emit(data Output)

func SetOutputKind

func SetOutputKind(kind Kind)

Types

type Kind

type Kind int
const (
	Terminal Kind = iota
	JSON
)

type Output

type Output interface {
	EmitTerminal() string
	EmitJSON() string
}

type Table

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

func NewTable

func NewTable() *Table

func (*Table) AddRow

func (t *Table) AddRow(columns ...interface{})

func (*Table) Render

func (t *Table) Render() string

func (*Table) SetColumnWidthMode

func (t *Table) SetColumnWidthMode(x int, mode TableColumnWidthMode)

func (*Table) SetHeader

func (t *Table) SetHeader(columns ...interface{})

type TableColumnWidthMode

type TableColumnWidthMode int
const (
	Minimum TableColumnWidthMode = iota
	Average
)

type TableRow

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

type Text

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

func Blue

func Blue(in string) *Text

func Green

func Green(in string) *Text

func HiWhite

func HiWhite(in string) *Text

func Red

func Red(in string) *Text

func White

func White(in string) *Text

func Yellow

func Yellow(in string) *Text

func (*Text) JustifyCenter

func (t *Text) JustifyCenter()

func (*Text) JustifyLeft

func (t *Text) JustifyLeft()

func (*Text) JustifyRight

func (t *Text) JustifyRight()

func (*Text) Len

func (t *Text) Len() int

func (*Text) Pad

func (t *Text) Pad(totalLen int) string

type TextBox

type TextBox interface {
	Len() int
	Pad(availableWidth int) string
}

func Sprintf

func Sprintf(format string, args ...interface{}) TextBox

Jump to

Keyboard shortcuts

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