progress

package
v2.40.3 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OutputDeviceIsTerminal added in v2.39.2

func OutputDeviceIsTerminal() bool

OutputDeviceIsTerminal returns true if stdout is a terminal.

func ShowIndicator

func ShowIndicator(message string, action func())

ShowIndicator displays a spinner animation while the action executes. In non-terminal environments (CI), it just executes the action without spinner.

Types

type Spinner added in v2.39.2

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

Spinner displays an animated progress indicator in the terminal.

func NewDefaultSpinner added in v2.39.2

func NewDefaultSpinner(message string, logger log.Logger) Spinner

NewDefaultSpinner creates a Spinner with default animation characters and timing, writing to stdout.

func NewDefaultSpinnerWithOutput added in v2.39.2

func NewDefaultSpinnerWithOutput(message string, output io.Writer, logger log.Logger) Spinner

NewDefaultSpinnerWithOutput creates a Spinner with default animation characters and timing.

func NewSpinner added in v2.39.2

func NewSpinner(message string, chars []string, delay time.Duration, writer io.Writer, logger log.Logger) Spinner

NewSpinner creates a new Spinner with custom animation characters and timing.

func (*Spinner) Run added in v2.39.2

func (s *Spinner) Run(action func())

Run starts the spinner animation and executes the given action. It waits for the action to complete before stopping the spinner.

Jump to

Keyboard shortcuts

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