spinner

package
v2.19.0-blackbird.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithProvider

func WithProvider(ctx context.Context, sp Provider) context.Context

Types

type Provider

type Provider interface {
	New(string) Spinner
}

type Spinner

type Spinner interface {
	Helper()

	// Start spinning the spinner.
	Start()

	// Done stops the spinner and prints a success icon.
	Done()

	// DoneMsg stops the spinner and sets the success icon with a new message.
	DoneMsg(msg string)

	// Error prints the error to the spinner, stops the spinner, then returns the error
	// so that you can continue passing it if needed.
	Error(err error) error

	// Message writes a message to the current spinner displayed alongside the initial job message.
	Message(msg string)
}

func New

func New(ctx context.Context, job string) Spinner

New configures a new spinner with the default values displaying the job message.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL