Documentation
¶
Index ¶
- func Start()
- func Stop()
- type Line
- func (r *Line) Done(a ...interface{}) *Line
- func (r *Line) Donef(format string, args ...interface{}) *Line
- func (r *Line) Error(a ...interface{}) *Line
- func (r *Line) Errorf(format string, args ...interface{}) *Line
- func (r *Line) Fatal(a ...interface{})
- func (r *Line) Fatalf(format string, args ...interface{})
- func (r *Line) GetProgress() (int64, int64)
- func (r *Line) Info(a ...interface{}) *Line
- func (r *Line) Infof(format string, args ...interface{}) *Line
- func (r *Line) Loading(a ...interface{}) *Line
- func (r *Line) Loadingf(format string, args ...interface{}) *Line
- func (r *Line) SetText(a ...interface{})
- func (r *Line) SetTextf(format string, args ...interface{})
- func (r *Line) Update()
- func (r *Line) Warn(a ...interface{}) *Line
- func (r *Line) Warnf(format string, args ...interface{}) *Line
- func (r *Line) WithProgress(current, total int64) *Line
- type State
- type Terminal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Line ¶
type Line struct {
Text string
// contains filtered or unexported fields
}
Line is single text line in the terminal output what you can change afterward
func (*Line) Fatal ¶
func (r *Line) Fatal(a ...interface{})
Fatal mark this line to be in error with given message Will exit(1) after rerendering the lines
func (*Line) Fatalf ¶
Fatalf mark this line to be in fatal with given format Will exit(1) after rerendering the lines
func (*Line) GetProgress ¶
func (*Line) SetText ¶
func (r *Line) SetText(a ...interface{})
SetText updates the text in the line
func (*Line) WithProgress ¶
WithProgress display progress bar when line is in loading state
type State ¶
type State int
State of the line
const ( // BLANK is the default state which just displays the text BLANK State = iota // LOADING state displays loading indicator, you must call Done() or Error() LOADING // DONE represents that the task were done DONE // WARN is something should be warned WARN // ERROR is something went wrong ERROR )
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
Terminal is tracks the Lines and updates all of them when needed
func NewTerminal ¶
func NewTerminal() *Terminal
NewTerminal creates new Terminal UI which prints output to the
Click to show internal directories.
Click to hide internal directories.