spinner

package
v1.116.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package spinner implements a small animated spinner on top of charm.land/bubbles/v2/spinner, for use in place of github.com/briandowns/spinner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Spinner

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

Spinner animates a labeled spinner on os.Stderr while a blocking operation runs elsewhere. Call Start to begin animating, then Stop once the operation finishes; Stop clears the spinner's line.

If os.Stderr isn't a terminal, Start instead prints the description once as a plain line, since an animated spinner would be meaningless in redirected or logged output; Stop is then a no-op.

func New

func New(description string) *Spinner

New returns a Spinner labeled with description, using the same frames and cadence as github.com/briandowns/spinner's CharSets[9].

func (*Spinner) Start

func (s *Spinner) Start()

Start begins animating the spinner in a background goroutine. It's a no-op if the spinner is already running.

func (*Spinner) Stop

func (s *Spinner) Stop()

Stop halts the animation and clears the spinner's line. It's safe to call even if Start hasn't been called, or has already been stopped.

Jump to

Keyboard shortcuts

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