prim

package module
v0.0.0-...-a1dd004 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: MIT Imports: 8 Imported by: 0

README

terminal-prim

Go Report Card

Primitives for terminal output

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProgressBar

func ProgressBar(count int)

ProgressBar creates a basic progress bar

Types

type Table

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

Table provides representation of the table

func NewTable

func NewTable() *Table

NewTable provides creating of the Table representation

func (*Table) AddHeaders

func (t *Table) AddHeaders(headers ...interface{})

AddHeaders provides adding of headers to the table

func (*Table) AddLines

func (t *Table) AddLines(lines ...interface{})

AddLines provides adding of the lines to the table

func (*Table) Output

func (t *Table) Output()

Output provides output table to console Example: tab := term.NewTable() tab.AddHeaders("aaa", "vvvv", "cccc") tab.AddLines("1", "2", "3") tab.Output()

aaa vvvv cccc --- ---- ---- 1 2 3

type Text

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

Text defines implementation basic things for text

func NewText

func NewText(text string) *Text

func (*Text) AlignCenter

func (t *Text) AlignCenter(width int) *Text

AlignCenter provides adding text to the center

func (*Text) Color

func (t *Text) Color(color string) *Text

Color provides coloring of the text

func (*Text) IdentLeft

func (t *Text) IdentLeft(n int) *Text

IdentLeft provides idents from left by n symbols

func (*Text) IdentTop

func (t *Text) IdentTop(n int) *Text

IdentTop provides ident from top on n symbols

func (*Text) Output

func (t *Text) Output() *Text

Output returns result string

func (*Text) RemoveEscapes

func (t *Text) RemoveEscapes() *Text

RemoveEscapes provides removing of escapes from the line

func (*Text) String

func (t *Text) String() string

String retruns string representation of the text

func (*Text) Text

func (t *Text) Text(str string) *Text

Text overwrites current main string

func (*Text) TrimSpace

func (t *Text) TrimSpace() *Text

TrimSpace provides removing of the spaces

type TextPipleline

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

Jump to

Keyboard shortcuts

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