spinner

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Complete spinnerStatus = iota
	Error
	Suspended
	Awaiting
	Progressing
)

Variables

This section is empty.

Functions

func IsTerminal

func IsTerminal() bool

Types

type Spinner

type Spinner struct {
	// contains filtered or unexported fields
}

Spinner manages a single spinner

func NewSpinner

func NewSpinner(options SpinnerOptions) *Spinner

NewSpinner creates a new spinner instance.

func (*Spinner) GetMessage

func (s *Spinner) GetMessage() string

GetMessage returns the current spinner message.

func (*Spinner) Print

func (s *Spinner) Print(w io.Writer, char string)

Print prints the spinner at a given position.

func (*Spinner) SetStatus

func (s *Spinner) SetStatus(status spinnerStatus)

SetStatus defines the status of the spinner.

func (*Spinner) UpdateMessage

func (s *Spinner) UpdateMessage(message string)

UpdateMessage updates the spinner message.

func (*Spinner) UpdateMessagef

func (s *Spinner) UpdateMessagef(format string, a ...interface{})

UpdateMessagef updates the spinner message with a formatted string.

type SpinnerManager

type SpinnerManager interface {
	AddSpinner(msg string) *Spinner
	GetSpinners() []*Spinner
	SetSpinnersCount(count int)
	Start()
	Stop()
}

SpinnerManager manages spinners

func NewSpinnerManager

func NewSpinnerManager(ctx context.Context) SpinnerManager

constructor for the SpinnerManager.

type SpinnerOptions

type SpinnerOptions struct {
	Message   string
	HasUpdate chan bool
}

Jump to

Keyboard shortcuts

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