Documentation ¶
Index ¶
- Variables
- func AddMessageRendererToContext(ctx context.Context, messageRenderer MessageRenderer) context.Context
- func AddSnapshotProgressToContext(ctx context.Context, snapshotProgress SnapshotProgress) context.Context
- 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)
- func SnapshotError(ctx context.Context)
- func UpdateSnapshotProgress(ctx context.Context, completedRows int)
- type MessageRenderer
- type NullSnapshotProgress
- type NullStatusHook
- type SnapshotProgress
- type StatusHooks
- type StatusSpinner
- type StatusSpinnerOpt
Constants ¶
This section is empty.
Variables ¶
View Source
var NullHooks = &NullStatusHook{}
View Source
var NullProgress = &NullSnapshotProgress{}
NullProgress is an empty implementation of SnapshotProgress
Functions ¶
func AddMessageRendererToContext ¶ added in v0.16.0
func AddMessageRendererToContext(ctx context.Context, messageRenderer MessageRenderer) context.Context
func AddSnapshotProgressToContext ¶ added in v0.17.0
func AddSnapshotProgressToContext(ctx context.Context, snapshotProgress SnapshotProgress) context.Context
func AddStatusHooksToContext ¶
func AddStatusHooksToContext(ctx context.Context, statusHooks StatusHooks) context.Context
func SnapshotError ¶ added in v0.17.0
func UpdateSnapshotProgress ¶ added in v0.17.0
Types ¶
type MessageRenderer ¶ added in v0.16.0
func MessageRendererFromContext ¶ added in v0.16.0
func MessageRendererFromContext(ctx context.Context) MessageRenderer
type NullSnapshotProgress ¶ added in v0.17.0
type NullSnapshotProgress struct{}
func (*NullSnapshotProgress) UpdateErrorCount ¶ added in v0.17.0
func (*NullSnapshotProgress) UpdateErrorCount(context.Context, int)
func (*NullSnapshotProgress) UpdateRowCount ¶ added in v0.17.0
func (*NullSnapshotProgress) UpdateRowCount(context.Context, int)
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 SnapshotProgress ¶ added in v0.17.0
type SnapshotProgress interface { UpdateRowCount(context.Context, int) UpdateErrorCount(context.Context, int) }
func SnapshotProgressFromContext ¶ added in v0.17.0
func SnapshotProgressFromContext(ctx context.Context) SnapshotProgress
type StatusHooks ¶
func StatusHooksFromContext ¶
func StatusHooksFromContext(ctx context.Context) StatusHooks
type StatusSpinner ¶
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 ¶
func NewStatusSpinner(opts ...StatusSpinnerOpt) *StatusSpinner
func (*StatusSpinner) Message ¶
func (s *StatusSpinner) Message(msgs ...string)
func (*StatusSpinner) SetStatus ¶
func (s *StatusSpinner) SetStatus(msg string)
SetStatus implements StatusHooks
func (*StatusSpinner) UpdateSpinnerMessage ¶
func (s *StatusSpinner) UpdateSpinnerMessage(newMessage string)
UpdateSpinnerMessage updates the message of the given spinner
type StatusSpinnerOpt ¶
type StatusSpinnerOpt func(*StatusSpinner)
func WithDelay ¶
func WithDelay(delay time.Duration) StatusSpinnerOpt
func WithMessage ¶
func WithMessage(msg string) StatusSpinnerOpt
Click to show internal directories.
Click to hide internal directories.