spinner

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(ctxDone <-chan struct{}, disabled bool, opts ...ComponentOption) (stop func())

Start starts a spinner in stderr and returns an idempotent stop function. Callers must provide a channel to ensure the spinner eventually stops.

Types

type ComponentOption

type ComponentOption func(*spinnerComponentOptions)

ComponentOption configures the spinner component behavior.

func WithDesign

func WithDesign(design spinner.Spinner) ComponentOption

func WithMessage

func WithMessage(message string) ComponentOption

func WithStopwatch added in v0.0.3

func WithStopwatch(startAfterSeconds uint64) ComponentOption

type Handle

type Handle interface {
	Stop()
	SetMessage(message string)
}

Handle allows callers to update the spinner's message and stop it.

func NewNoopHandle

func NewNoopHandle() Handle

NewNoopHandle returns a handle that performs no work.

func StartWithHandle

func StartWithHandle(ctxDone <-chan struct{}, disabled bool, opts ...ComponentOption) Handle

StartWithHandle starts a spinner and returns a handle that can update the message and stop the spinner.

Jump to

Keyboard shortcuts

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