Documentation ¶
Index ¶
- Variables
- func AddStatusHooksToContext(ctx context.Context, statusHooks StatusHooks) context.Context
- func DisableStatusHooks(ctx context.Context) context.Context
- func Done(ctx context.Context)
- func Message(ctx context.Context, msgs ...string)
- func SetStatus(ctx context.Context, msg string)
- type NullStatusHook
- type StatusHooks
- type StatusSpinner
- type StatusSpinnerOpt
Constants ¶
This section is empty.
Variables ¶
View Source
var NullHooks = &NullStatusHook{}
Functions ¶
func AddStatusHooksToContext ¶
func AddStatusHooksToContext(ctx context.Context, statusHooks StatusHooks) context.Context
Types ¶
type NullStatusHook ¶
type NullStatusHook struct{}
func (*NullStatusHook) Done ¶
func (*NullStatusHook) Done()
func (*NullStatusHook) Message ¶
func (*NullStatusHook) Message(...string)
func (*NullStatusHook) SetStatus ¶
func (*NullStatusHook) SetStatus(string)
type StatusHooks ¶
func StatusHooksFromContext ¶
func StatusHooksFromContext(ctx context.Context) StatusHooks
type StatusSpinner ¶ added in v0.13.0
type StatusSpinner struct {
// contains filtered or unexported fields
}
StatusSpinner is a struct which implements StatusHooks, and uses a spinner to display status messages
func NewStatusSpinner ¶ added in v0.13.0
func NewStatusSpinner(opts ...StatusSpinnerOpt) *StatusSpinner
func (*StatusSpinner) Done ¶ added in v0.13.0
func (s *StatusSpinner) Done()
Done implements StatusHooks
func (*StatusSpinner) Message ¶ added in v0.13.0
func (s *StatusSpinner) Message(msgs ...string)
func (*StatusSpinner) SetStatus ¶ added in v0.13.0
func (s *StatusSpinner) SetStatus(msg string)
SetStatus implements StatusHooks
func (*StatusSpinner) UpdateSpinnerMessage ¶ added in v0.13.0
func (s *StatusSpinner) UpdateSpinnerMessage(newMessage string)
UpdateSpinnerMessage updates the message of the given spinner
type StatusSpinnerOpt ¶ added in v0.13.0
type StatusSpinnerOpt func(*StatusSpinner)
func WithDelay ¶ added in v0.13.0
func WithDelay(delay time.Duration) StatusSpinnerOpt
func WithMessage ¶ added in v0.13.0
func WithMessage(msg string) StatusSpinnerOpt
Click to show internal directories.
Click to hide internal directories.