Documentation ¶
Index ¶
- Constants
- type Out
- func (o *Out) AltScreen()
- func (o *Out) ChangeScrollingRegion(top, bottom int)
- func (o *Out) ClearLine()
- func (o *Out) ClearLineLeft()
- func (o *Out) ClearLineRight()
- func (o *Out) ClearLines(n int)
- func (o *Out) ClearScreen()
- func (o *Out) CursorBack(n int)
- func (o *Out) CursorDown(n int)
- func (o *Out) CursorForward(n int)
- func (o *Out) CursorNextLine(n int)
- func (o *Out) CursorPrevLine(n int)
- func (o *Out) CursorUp(n int)
- func (o *Out) DeleteLines(n int)
- func (o *Out) ExitAltScreen()
- func (o *Out) HideCursor()
- func (o *Out) InsertLines(n int)
- func (o *Out) MoveCursor(row, column int)
- func (o *Out) Print(messages ...interface{})
- func (o *Out) Printf(format string, args ...interface{})
- func (o *Out) Println(messages ...interface{})
- func (o *Out) Reset()
- func (o *Out) ResetColor()
- func (o *Out) RestoreCursorPosition()
- func (o *Out) RestoreScreen()
- func (o *Out) SaveCursorPosition()
- func (o *Out) SaveScreen()
- func (o *Out) SetColor(colorCode int)
- func (o *Out) SetWindowTitle(title string)
- func (o *Out) ShowCursor()
- type Output
- type ProgressBar
- type Spinner
- type Term
Constants ¶
const ( Black = iota Red Green Yellow Blue Magenta Cyan White BrightBlack BrightRed BrightGreen BrightYellow BrightBlue BrightMagenta BrightCyan BrightWhite )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Out ¶
type Out struct {
// contains filtered or unexported fields
}
Out manages the cli outputs that is user facing with many functionalities to manage and control the TUI (Terminal User Interface).
func (*Out) AltScreen ¶
func (o *Out) AltScreen()
AltScreen switches to the alternate screen buffer. The former view can be restored with ExitAltScreen().
func (*Out) ChangeScrollingRegion ¶
ChangeScrollingRegion sets the scrolling region of the terminal.
func (*Out) ClearLineLeft ¶
func (o *Out) ClearLineLeft()
ClearLineLeft clears the line to the left of the cursor.
func (*Out) ClearLineRight ¶
func (o *Out) ClearLineRight()
ClearLineRight clears the line to the right of the cursor.
func (*Out) ClearScreen ¶
func (o *Out) ClearScreen()
ClearScreen clears the visible portion of the terminal.
func (*Out) CursorBack ¶
CursorBack moves the cursor backwards a given number of cells.
func (*Out) CursorDown ¶
CursorDown moves the cursor down a given number of lines.
func (*Out) CursorForward ¶
CursorForward moves the cursor up a given number of lines.
func (*Out) CursorNextLine ¶
CursorNextLine moves the cursor down a given number of lines and places it at the beginning of the line.
func (*Out) CursorPrevLine ¶
CursorPrevLine moves the cursor up a given number of lines and places it at the beginning of the line.
func (*Out) DeleteLines ¶
DeleteLines deletes the given number of lines, pulling any lines in the scrollable region below up.
func (*Out) ExitAltScreen ¶
func (o *Out) ExitAltScreen()
ExitAltScreen exits the alternate screen buffer and returns to the former terminal view.
func (*Out) InsertLines ¶
InsertLines inserts the given number of lines at the top of the scrollable region, pushing lines below down.
func (*Out) MoveCursor ¶
MoveCursor moves the cursor to a given position.
func (*Out) Reset ¶
func (o *Out) Reset()
Reset the terminal to its default style, removing any active styles.
func (*Out) ResetColor ¶
func (o *Out) ResetColor()
func (*Out) RestoreCursorPosition ¶
func (o *Out) RestoreCursorPosition()
RestoreCursorPosition restores a saved cursor position.
func (*Out) RestoreScreen ¶
func (o *Out) RestoreScreen()
RestoreScreen restores a previously saved screen state.
func (*Out) SaveCursorPosition ¶
func (o *Out) SaveCursorPosition()
SaveCursorPosition saves the cursor position.
func (*Out) SetWindowTitle ¶
SetWindowTitle sets the terminal window title.
type Output ¶
type Output interface { AltScreen() ChangeScrollingRegion(top int, bottom int) ClearLine() ClearLineLeft() ClearLineRight() ClearLines(n int) ClearScreen() CursorBack(n int) CursorDown(n int) CursorForward(n int) CursorNextLine(n int) CursorPrevLine(n int) CursorUp(n int) DeleteLines(n int) ExitAltScreen() HideCursor() InsertLines(n int) MoveCursor(row int, column int) Print(messages ...any) Printf(format string, args ...any) Println(messages ...any) Reset() ResetColor() RestoreCursorPosition() RestoreScreen() SaveCursorPosition() SaveScreen() SetColor(colorCode int) SetWindowTitle(title string) ShowCursor() // contains filtered or unexported methods }
type ProgressBar ¶
type ProgressBar struct {
// contains filtered or unexported fields
}
func NewProgressBar ¶
func NewProgressBar(out Output, total int64) (*ProgressBar, error)
func (*ProgressBar) Incr ¶
func (p *ProgressBar) Incr(i int64) bool
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner is a TUI component that displays a loading spinner which can be used to denote a running background process.