Documentation ¶
Index ¶
- type OptionFunc
- type Spinner
- func (s *Spinner) ClearCurrentLine()
- func (s *Spinner) Error(message ...string)
- func (s *Spinner) Errorf(format string, args ...interface{})
- func (s *Spinner) SetAbortMessage(message string)
- func (s *Spinner) SetErrorSymbol(symbol string)
- func (s *Spinner) SetSpinFrames(frames []string)
- func (s *Spinner) SetSpinSpeed(ms int)
- func (s *Spinner) SetSuccessSymbol(symbol string)
- func (s *Spinner) Start(optionalMessage ...string)
- func (s *Spinner) Stop()
- func (s *Spinner) Success(message ...string)
- func (s *Spinner) Successf(format string, args ...interface{})
- func (s *Spinner) UpdateMessage(message string)
- func (s *Spinner) WithOptions(opts ...OptionFunc) *Spinner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OptionFunc ¶ added in v0.5.5
type OptionFunc func(s *Spinner)
OptionFunc is a wrapper option func to spinner
func WithExitOnAbort ¶ added in v0.5.5
func WithExitOnAbort(exit bool) OptionFunc
WithExitOnAbort sets abortOnExit field to spinner
func WithNotifySignals ¶ added in v0.5.8
func WithNotifySignals(notify bool) OptionFunc
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner defines our spinner data.
func NewSpinner ¶
NewSpinner creates a new spinner and sets up the default values.
func (*Spinner) ClearCurrentLine ¶ added in v0.5.6
func (s *Spinner) ClearCurrentLine()
ClearCurrentLine clears the current line
func (*Spinner) Error ¶
Error stops the spinner and sets the status code to error. Optional message to print instead of current message.
func (*Spinner) Errorf ¶
Errorf stops the spinner, formats and sets the status code to error. Formats and prints the given message instead of current message.
func (*Spinner) SetAbortMessage ¶ added in v0.4.0
SetAbortMessage sets the message that gets printed when the user kills the spinners by pressing ctrl-c.
func (*Spinner) SetErrorSymbol ¶
SetErrorSymbol sets the symbol displayed on error.
func (*Spinner) SetSpinFrames ¶
SetSpinFrames makes the spinner use the given characters.
func (*Spinner) SetSpinSpeed ¶
SetSpinSpeed sets the speed of the spinner animation. The lower the value, the faster the spin.
func (*Spinner) SetSuccessSymbol ¶
SetSuccessSymbol sets the symbol displayed on success.
func (*Spinner) Success ¶
Success stops the spinner and sets the status code to success. Optional message to print instead of current message.
func (*Spinner) Successf ¶
Successf stops the spinner, formats and sets the status code to success. Formats and prints the given message instead of current message.
func (*Spinner) UpdateMessage ¶ added in v0.4.0
UpdateMessage sets the spinner message. Can be flickery if not appending so use with care.
func (*Spinner) WithOptions ¶ added in v0.5.5
func (s *Spinner) WithOptions(opts ...OptionFunc) *Spinner
WithOptions passes spinner and runs every option func