package
3.3.2+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.
FilterStrings filters the slice 's' to items which return truth when passed to 'f'.
FixedLengthString returns the given string with a fixed length.
GetLongestLineLength returns the length of the longest "line" within the argument string.
InsertRuneEveryN inserts the rune every N characters in the string.
RepeatAndTrim repeats the given string until it is as long as maxRunes.
RuneCountWithoutEscapeSeq is similar to utf8.RuneCountInString, except for the fact that it ignores escape sequences in the counting.
TrimTextWithoutEscapeSeq trims a string to the given length accounting for escape sequences For ex.: TrimTextWithoutEscapeSeq("Ghost", 3) == "Gho" TrimTextWithoutEscapeSeq("Ghost", 6) == "Ghost" TrimTextWithoutEscapeSeq("\x1b[33mGhost\x1b[0m", 3) == "\x1b[33mGho\x1b[0m" TrimTextWithoutEscapeSeq("\x1b[33mGhost\x1b[0m", 6) == "\x1b[33mGhost\x1b[0m".
WrapText wraps a string to the given length using a newline.
# 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.
VAlign denotes how text is to be aligned vertically.