spinner

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

README

pkg/spinner

spinner renders an animated terminal progress indicator. It degrades gracefully on non-TTY outputs (CI logs, piped output) by printing a single line without animation.

s := spinner.Start("Generating RBAC...")
// ... do work ...
s.Done("✅ RBAC generated")
// or on failure:
s.Fail("❌ generation failed")

On a TTY the spinner animates with braille frames (⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏). On non-TTY it prints the message once and is immediately considered finalised — subsequent Done / Fail calls are no-ops.

Used by ork generate, ork simulate, and ork doctor to indicate long-running operations without leaving raw log output in interactive sessions.

Documentation

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 terminal progress indicator with a message.

func Start

func Start(msg string) *Spinner

Start begins the spinner; on non-TTY it prints once and finalizes.

func (*Spinner) Failure

func (s *Spinner) Failure()

Failure prints a red ✗ and finalizes the spinner.

func (*Spinner) Stop

func (s *Spinner) Stop()

Stop halts animation and clears the line.

func (*Spinner) Success

func (s *Spinner) Success()

Success prints a green ✓ and finalizes the spinner.

func (*Spinner) Update

func (s *Spinner) Update(msg string)

Update changes the spinner's message while running.

Jump to

Keyboard shortcuts

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