spinner

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Unlicense Imports: 2 Imported by: 0

Documentation

Overview

Package spinner provides a terminal spinner that counts and tracks elapsed time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Spinner

type Spinner struct {
	Chars []string
	Start time.Time
	Count int
}

Spinner cycles chars on term to indicate activity.

func New

func New() *Spinner

New creates a Spinner with Chars prepopulated.

func (*Spinner) Elapsed

func (sp *Spinner) Elapsed() (secs float64)

Elapsed reports seconds since the first Spin.

func (*Spinner) Spin

func (sp *Spinner) Spin()

Spin prints the next character.

Jump to

Keyboard shortcuts

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