show

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2018 License: MIT Imports: 3 Imported by: 0

README

formatted message show

contains section, panel, padding, helpPanel, table, tree, title, list, multiList

  • title

  • table

  • panel

  • section

  • padding

  • list

  • multi list

  • alert(block)

  • markdown

  • json

  • progress text

  • progress bar

  • counter

Documentation

Index

Constants

View Source
const (
	// OK success exit code
	OK = 0
	// ERR error exit code
	ERR = 2
)

Variables

This section is empty.

Functions

func Error

func Error(format string, v ...interface{}) int

Error message print

func JSON

func JSON(v interface{}, settings ...string)

JSON print pretty JSON data

func New

func New()

New a

Types

type IFormatter

type IFormatter interface {
	Format() string
}

IFormatter

type IShow

type IShow interface {
	// print current message
	Print()
	// trans to string
	String() string
}

show shown

type List

type List struct {
	Name  string
	Items interface{}
}

List list

func NewList

func NewList(name string, items interface{}) *List

NewList

func (*List) Format

func (l *List) Format() string

func (*List) Print

func (l *List) Print()

func (*List) String

func (l *List) String() string

type Lists

type Lists struct {
	Title string
	Rows  []List
}

Lists lists

func NewLists

func NewLists(title string, lists []List) *Lists

NewLists

func (*Lists) Format

func (ls *Lists) Format()

func (*Lists) Print

func (ls *Lists) Print()

func (*Lists) String

func (ls *Lists) String() string

type Table

type Table struct {
	Name       string
	Cols       []string
	Rows       []interface{}
	Border     bool
	RowBorder  bool
	HeadBorder bool
	WrapBorder bool
}

Table a cli Table show

func NewTable

func NewTable(name string) *Table

NewTable

func (*Table) Format

func (t *Table) Format() string

func (*Table) Print

func (t *Table) Print()

func (*Table) String

func (t *Table) String() string

type Title

type Title struct {
	Title     string
	Formatter func(t *Title) string
}

func NewTitle

func NewTitle(title string) *Title

Jump to

Keyboard shortcuts

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