Documentation ¶
Index ¶
- func SetOutput(o Output)
- func Start()
- func Stop()
- type Debug
- type DebugLine
- func (r *DebugLine) Done(a ...interface{}) Line
- func (r *DebugLine) Donef(format string, args ...interface{}) Line
- func (r *DebugLine) Error(a ...interface{}) Line
- func (r *DebugLine) Errorf(format string, args ...interface{}) Line
- func (r *DebugLine) Fatal(a ...interface{})
- func (r *DebugLine) Fatalf(format string, args ...interface{})
- func (r *DebugLine) Info(a ...interface{}) Line
- func (r *DebugLine) Infof(format string, args ...interface{}) Line
- func (r *DebugLine) Loading(a ...interface{}) Line
- func (r *DebugLine) Loadingf(format string, args ...interface{}) Line
- func (r *DebugLine) Warn(a ...interface{}) Line
- func (r *DebugLine) Warnf(format string, args ...interface{}) Line
- func (r *DebugLine) WithProgress(current, total int64) Line
- type Hidden
- type HiddenLine
- func (r *HiddenLine) Done(a ...interface{}) Line
- func (r *HiddenLine) Donef(format string, args ...interface{}) Line
- func (r *HiddenLine) Error(a ...interface{}) Line
- func (r *HiddenLine) Errorf(format string, args ...interface{}) Line
- func (r *HiddenLine) Fatal(a ...interface{})
- func (r *HiddenLine) Fatalf(format string, args ...interface{})
- func (r *HiddenLine) Info(a ...interface{}) Line
- func (r *HiddenLine) Infof(format string, args ...interface{}) Line
- func (r *HiddenLine) Loading(a ...interface{}) Line
- func (r *HiddenLine) Loadingf(format string, args ...interface{}) Line
- func (r *HiddenLine) Warn(a ...interface{}) Line
- func (r *HiddenLine) Warnf(format string, args ...interface{}) Line
- func (r *HiddenLine) WithProgress(current, total int64) Line
- type Line
- type Output
- type State
- type Terminal
- type TerminalLine
- func (r *TerminalLine) Done(a ...interface{}) Line
- func (r *TerminalLine) Donef(format string, args ...interface{}) Line
- func (r *TerminalLine) Error(a ...interface{}) Line
- func (r *TerminalLine) Errorf(format string, args ...interface{}) Line
- func (r *TerminalLine) Fatal(a ...interface{})
- func (r *TerminalLine) Fatalf(format string, args ...interface{})
- func (r *TerminalLine) Info(a ...interface{}) Line
- func (r *TerminalLine) Infof(format string, args ...interface{}) Line
- func (r *TerminalLine) Loading(a ...interface{}) Line
- func (r *TerminalLine) Loadingf(format string, args ...interface{}) Line
- func (r *TerminalLine) Update()
- func (r *TerminalLine) Warn(a ...interface{}) Line
- func (r *TerminalLine) Warnf(format string, args ...interface{}) Line
- func (r *TerminalLine) WithProgress(current, total int64) Line
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Debug ¶
type Debug struct {
// contains filtered or unexported fields
}
Debug is log implementation which just outputs line by line
type DebugLine ¶
type DebugLine struct { }
DebugLine is Line implementation which just outputs all the lines to the terminal
func (*DebugLine) Fatal ¶
func (r *DebugLine) Fatal(a ...interface{})
Fatal mark this line to be in error with given message Will exit(1) after rerendering the lines
func (*DebugLine) Fatalf ¶
Fatalf mark this line to be in fatal with given format Will exit(1) after rerendering the lines
func (*DebugLine) WithProgress ¶
WithProgress display progress bar when line is in loading state
type Hidden ¶
type Hidden struct { }
Hidden is log output implementation what doesn't output anything
type HiddenLine ¶
type HiddenLine struct { }
HiddenLine is Line implementation which don't output anything
func (*HiddenLine) Done ¶
func (r *HiddenLine) Done(a ...interface{}) Line
Done marks this line to be done and updates the text
func (*HiddenLine) Donef ¶
func (r *HiddenLine) Donef(format string, args ...interface{}) Line
Donef marks this line to be done and updates the text
func (*HiddenLine) Error ¶
func (r *HiddenLine) Error(a ...interface{}) Line
Error mark this line to be in error with given message
func (*HiddenLine) Errorf ¶
func (r *HiddenLine) Errorf(format string, args ...interface{}) Line
Errorf mark this line to be in error with given format
func (*HiddenLine) Fatal ¶
func (r *HiddenLine) Fatal(a ...interface{})
Fatal mark this line to be in error with given message Will exit(1) after rerendering the lines
func (*HiddenLine) Fatalf ¶
func (r *HiddenLine) Fatalf(format string, args ...interface{})
Fatalf mark this line to be in fatal with given format Will exit(1) after rerendering the lines
func (*HiddenLine) Info ¶
func (r *HiddenLine) Info(a ...interface{}) Line
Info mark this line to be just blank info line
func (*HiddenLine) Infof ¶
func (r *HiddenLine) Infof(format string, args ...interface{}) Line
Infof mark this line to be just blank info line
func (*HiddenLine) Loading ¶
func (r *HiddenLine) Loading(a ...interface{}) Line
Loading mark this line to be loading (displays loading indicator)
func (*HiddenLine) Loadingf ¶
func (r *HiddenLine) Loadingf(format string, args ...interface{}) Line
Loadingf mark this line to be loading (displays loading indicator)
func (*HiddenLine) Warn ¶
func (r *HiddenLine) Warn(a ...interface{}) Line
Warn mark this line to be in warning with given message
func (*HiddenLine) Warnf ¶
func (r *HiddenLine) Warnf(format string, args ...interface{}) Line
Warnf mark this line to be in warning with given format
func (*HiddenLine) WithProgress ¶
func (r *HiddenLine) WithProgress(current, total int64) Line
WithProgress display progress bar when line is in loading state
type Line ¶
type Line interface { WithProgress(current, total int64) Line Infof(format string, args ...interface{}) Line Info(a ...interface{}) Line Loadingf(format string, args ...interface{}) Line Loading(a ...interface{}) Line Donef(format string, args ...interface{}) Line Done(a ...interface{}) Line Warnf(format string, args ...interface{}) Line Warn(a ...interface{}) Line Errorf(format string, args ...interface{}) Line Error(a ...interface{}) Line Fatalf(format string, args ...interface{}) Fatal(a ...interface{}) }
Line represents single ine in terminal output
type Output ¶
type Output interface { Start() Stop() NewLine() Line }
Output is interface for log outputs
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 os.Stdout
type TerminalLine ¶
type TerminalLine struct { Text string // contains filtered or unexported fields }
TerminalLine is single text line in the terminal output what you can change afterward
func (*TerminalLine) Done ¶
func (r *TerminalLine) Done(a ...interface{}) Line
Done marks this line to be done and updates the text
func (*TerminalLine) Donef ¶
func (r *TerminalLine) Donef(format string, args ...interface{}) Line
Donef marks this line to be done and updates the text
func (*TerminalLine) Error ¶
func (r *TerminalLine) Error(a ...interface{}) Line
Error mark this line to be in error with given message
func (*TerminalLine) Errorf ¶
func (r *TerminalLine) Errorf(format string, args ...interface{}) Line
Errorf mark this line to be in error with given format
func (*TerminalLine) Fatal ¶
func (r *TerminalLine) Fatal(a ...interface{})
Fatal mark this line to be in error with given message Will exit(1) after rerendering the lines
func (*TerminalLine) Fatalf ¶
func (r *TerminalLine) Fatalf(format string, args ...interface{})
Fatalf mark this line to be in fatal with given format Will exit(1) after rerendering the lines
func (*TerminalLine) Info ¶
func (r *TerminalLine) Info(a ...interface{}) Line
Info mark this line to be just blank info line
func (*TerminalLine) Infof ¶
func (r *TerminalLine) Infof(format string, args ...interface{}) Line
Infof mark this line to be just blank info line
func (*TerminalLine) Loading ¶
func (r *TerminalLine) Loading(a ...interface{}) Line
Loading mark this line to be loading (displays loading indicator)
func (*TerminalLine) Loadingf ¶
func (r *TerminalLine) Loadingf(format string, args ...interface{}) Line
Loadingf mark this line to be loading (displays loading indicator)
func (*TerminalLine) Warn ¶
func (r *TerminalLine) Warn(a ...interface{}) Line
Warn mark this line to be in warning with given message
func (*TerminalLine) Warnf ¶
func (r *TerminalLine) Warnf(format string, args ...interface{}) Line
Warnf mark this line to be in warning with given format
func (*TerminalLine) WithProgress ¶
func (r *TerminalLine) WithProgress(current, total int64) Line
WithProgress display progress bar when line is in loading state