package
4.3.0+incompatible
Repository: https://github.com/static-flow/go-pretty.git
Documentation: pkg.go.dev

# Functions

DisableColors (forcefully) disables color coding globally.
EnableColors (forcefully) enables color coding globally.
Escape encodes the string with the ANSI Escape Sequence.
Filter filters the slice 's' to items which return truth when passed to 'f'.
InsertEveryN inserts the rune every N characters in the string.
LongestLineLen returns the length of the longest "line" within the argument string.
NewJSONTransformer returns a Transformer that can format a JSON string or an object into pretty-indented JSON-strings.
NewNumberTransformer returns a number Transformer that: * transforms the number as directed by 'format' (ex.: %.2f) * colors negative values Red * colors positive values Green.
NewTimeTransformer returns a Transformer that can format a timestamp (a time.Time or strfmt.DateTime object) into a well-defined time format defined using the provided layout (ex.: time.RFC3339).
NewUnixTimeTransformer returns a Transformer that can format a unix-timestamp into a well-defined time format as defined by 'layout'.
NewURLTransformer returns a Transformer that can format and pretty print a string that contains an URL (the text is underlined and colored Blue).
Pad pads the given string with as many characters as needed to make it as long as specified (maxLen).
RepeatAndTrim repeats the given string until it is as long as maxRunes.
RuneCount is similar to utf8.RuneCountInString, except for the fact that it ignores escape sequences while counting.
RuneWidth returns the mostly accurate character-width of the rune.
Snip returns the given string with a fixed length.
StripEscape strips all ANSI Escape Sequence from the string.
Trim trims a string to the given length while ignoring escape sequences.
WrapHard wraps a string to the given length using a newline.
WrapSoft wraps a string to the given length using a newline.
WrapText is very similar to WrapHard except for one minor difference.

# Constants

" center ".
same as AlignLeft.
"justify it".
"left ".
" right".
Background colors.
Background colors.
Background colors.
Background colors.
Background Hi-Intensity colors.
Background Hi-Intensity colors.
Background Hi-Intensity colors.
Background Hi-Intensity colors.
Background Hi-Intensity colors.
Background Hi-Intensity colors.
Background Hi-Intensity colors.
Background Hi-Intensity colors.
Background colors.
Background colors.
Background colors.
Background colors.
Base colors -- attributes in reality.
Base colors -- attributes in reality.
Base colors -- attributes in reality.
Base colors -- attributes in reality.
Base colors -- attributes in reality.
CursorDown helps move the Cursor Down X lines.
CursorLeft helps move the Cursor Left X characters.
CursorRight helps move the Cursor Right X characters.
CursorUp helps move the Cursor Up X lines.
EraseLine helps erase all characters to the Right of the Cursor in the current line.
Constants.
Constants.
\x1b.
Constants.
Constants.
Base colors -- attributes in reality.
Foreground colors.
Foreground colors.
Foreground colors.
Foreground colors.
Foreground Hi-Intensity colors.
Foreground Hi-Intensity colors.
Foreground Hi-Intensity colors.
Foreground Hi-Intensity colors.
Foreground Hi-Intensity colors.
Foreground Hi-Intensity colors.
Foreground Hi-Intensity colors.
Foreground Hi-Intensity colors.
Foreground colors.
Foreground colors.
Foreground colors.
Foreground colors.
default_Case.
lower.
Title.
UPPER.
Base colors -- attributes in reality.
Base colors -- attributes in reality.
Base colors -- attributes in reality.
Base colors -- attributes in reality.
"\n\nbottom".
same as VAlignTop.
"\nmiddle\n".
"top\n\n".

# Variables

ANSICodesSupported will be true on consoles where ANSI Escape Codes/Sequences are supported.

# Type aliases

Align denotes how text is to be aligned horizontally.
Color represents a single color to render with.
Colors represents an array of Color objects to render with.
Cursor helps move the cursor on the console in multiple directions.
Format denotes the "case" to use for text.
Transformer helps format the contents of an object to the user's liking.
VAlign denotes how text is to be aligned vertically.