Documentation
¶
Index ¶
- Constants
- func AlignCenter(maxWidth int, st, padding string) string
- func AlignLeft(maxWidth int, st, padding string) string
- func AlignRight(maxWidth int, st, padding string) string
- func BuildString(substrings ...string) string
- func Cell(x, y int)
- func ClearRow(x, y, len int)
- func ClearScreen()
- func HideCursor()
- func NewTerminal() *terminal
- func ShowCursor()
- func SplitString(s string) (int, []rune)
- func StrLen(st string) int
- func TrimEnd(input string, maxLen, trimLen, swaps int, swapChar rune) string
- type CommandLine
- func (c *CommandLine) Backspace()
- func (c *CommandLine) DeleteChar()
- func (c *CommandLine) GetOutput() string
- func (c *CommandLine) GoToLineEnd()
- func (c *CommandLine) GoToLineStart()
- func (c *CommandLine) InsertChar(r rune)
- func (c *CommandLine) NextCol()
- func (c *CommandLine) PrevCol()
- func (c *CommandLine) Print()
- func (cmd *CommandLine) WaitInput() string
- type Navigator
- func (c *Navigator) CalculateEndIndex(index, maxIndex int) int
- func (c *Navigator) CalculateStartIndex(index int) int
- func (c *Navigator) FirstEntry() (res bool)
- func (c *Navigator) GetIndexOffset(index int) int
- func (c *Navigator) Index() int
- func (c *Navigator) IndiceRange(index, lastIndex int) (int, int)
- func (c *Navigator) Jump(from, to, maxIndex int) bool
- func (c *Navigator) LastEntry() (res bool)
- func (c *Navigator) MovePgDown(visibleLines int) bool
- func (c *Navigator) MovePgUp() bool
- func (c *Navigator) NextEntry() bool
- func (c *Navigator) PrevEntry() bool
- func (c *Navigator) Reset()
- func (c *Navigator) SetIndex(i int)
- func (c *Navigator) ShouldUpdateChunk() bool
- type Section
- func (s *Section) CenterHorizontally() *Section
- func (s *Section) CenterVertically() *Section
- func (s *Section) ContentFirstLine() int
- func (s *Section) ContentLines() int
- func (s *Section) ContentStart() int
- func (s *Section) ContentWidth() int
- func (s *Section) OutputFirstLine() int
- func (s *Section) OutputLastLine() int
- func (s *Section) Print(formatting string)
- func (s *Section) PrintBorder(formatting string)
- func (s *Section) PrintContent() (row int)
- func (c *Section) PrintLine(row int, line string)
- func (s *Section) SetBorder() *Section
- func (s *Section) SetHeight(h int) *Section
- func (s *Section) SetLeft(left int)
- func (s *Section) SetPadding(Top, right, bottom, Left int) *Section
- func (s *Section) SetTop(top int)
- func (s *Section) SetWidth(w int) *Section
Constants ¶
View Source
const ( Reset = "\033[0m" Bold = "\033[1m" Italic = "\033[3m" Underscore = "\033[4m" Backslash = "\u2572" Slash = "\u2571" DoubleHorizontal = "\u2550" DoubleVertical = "\u2551" HorizontalSeparator = "\u2500" Tee = "\u251c" Corner = "\u2514" BorderTopLeft = "\u250F" BordertTopLeftAlt = "\u2554" BorderTopRight = "\u2513" BorderTopRightAlt = "\u2557" BorderBottomLeft = "\u2517" BorderBottomLeftAlt = "\u255A" BorderBottomRight = "\u251B" BorderBottomRIghtAlt = "\u255D" BorderVertical = "\u2503" BorderVerticalAlt = "\u2551" BorderHorizontal = "\u2501" BorderHorizontalAlt = "\u2550" CursorLeft = "\033[D" CursorRight = "\033[C" CursorHide = "\033[?25l" CursorShow = "\033[?25h" CursorTop = "\033[H" Block = "\u2591" Space = " " Line = "\u2594" CarriageReturn = "\r" ClearLine = "\033[2K" Segment = Slash + Block + Slash Black = "\033[30m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Magenta = "\033[35m" Cyan = "\033[36m" White = "\033[37m" BrightBlack = "\033[90m" BrightRed = "\033[91m" BrightGreen = "\033[92m" BrightYellow = "\033[93m" BrightBlue = "\033[94m" BrightMagenta = "\033[95m" BrightCyan = "\033[96m" BrightWhite = "\033[97m" BgBlack = "\033[40m" BgRed = "\033[41m" BgGreen = "\033[42m" BgYellow = "\033[43m" BgBlue = "\033[44m" BgMagenta = "\033[45m" BgCyan = "\033[46m" BgWhite = "\033[47m" BgBrightBlack = "\033[100m" BgBrightRed = "\033[101m" BgBrightGreen = "\033[102m" BgBrightYellow = "\033[103m" BgBrightBlue = "\033[104m" BgBrightMagenta = "\033[105m" BgBrightCyan = "\033[106m" BgBrightWhite = "\033[107m" )
Variables ¶
This section is empty.
Functions ¶
func AlignCenter ¶
func AlignRight ¶
func BuildString ¶
func ClearScreen ¶
func ClearScreen()
func HideCursor ¶
func HideCursor()
func NewTerminal ¶
func NewTerminal() *terminal
func ShowCursor ¶
func ShowCursor()
func SplitString ¶
Types ¶
type CommandLine ¶
type CommandLine struct {
// contains filtered or unexported fields
}
func NewCommandLine ¶
func (*CommandLine) Backspace ¶
func (c *CommandLine) Backspace()
func (*CommandLine) DeleteChar ¶
func (c *CommandLine) DeleteChar()
func (*CommandLine) GetOutput ¶
func (c *CommandLine) GetOutput() string
func (*CommandLine) GoToLineEnd ¶
func (c *CommandLine) GoToLineEnd()
func (*CommandLine) GoToLineStart ¶
func (c *CommandLine) GoToLineStart()
func (*CommandLine) InsertChar ¶
func (c *CommandLine) InsertChar(r rune)
func (*CommandLine) NextCol ¶
func (c *CommandLine) NextCol()
func (*CommandLine) PrevCol ¶
func (c *CommandLine) PrevCol()
func (*CommandLine) Print ¶
func (c *CommandLine) Print()
func (*CommandLine) WaitInput ¶
func (cmd *CommandLine) WaitInput() string
type Navigator ¶
type Navigator struct {
// contains filtered or unexported fields
}
func (*Navigator) CalculateEndIndex ¶
func (*Navigator) CalculateStartIndex ¶
func (*Navigator) FirstEntry ¶
func (*Navigator) GetIndexOffset ¶
func (*Navigator) MovePgDown ¶
func (*Navigator) ShouldUpdateChunk ¶
type Section ¶
type Section struct {
Content []string
Width int
Height int
Top int
Left int
PaddingTop int
PaddingBottom int
PaddingLeft int
PaddingRight int
BorderTopWidth int
BorderLeftWidth int
BorderRightWidth int
BorderBottomWidth int
// contains filtered or unexported fields
}
func NewSection ¶
func NewSection() Section
func (*Section) CenterHorizontally ¶
func (*Section) CenterVertically ¶
func (*Section) ContentFirstLine ¶
func (*Section) ContentLines ¶
func (*Section) ContentStart ¶
func (*Section) ContentWidth ¶
func (*Section) OutputFirstLine ¶
func (*Section) OutputLastLine ¶
func (*Section) PrintBorder ¶
func (*Section) PrintContent ¶
func (*Section) SetPadding ¶
Click to show internal directories.
Click to hide internal directories.