spinner

package
v0.0.0-...-af06d55 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 150ms per frame
	DEFAULT_FRAME_RATE = time.Millisecond * 150
)

Variables

View Source
var DefaultCharset = []string{"|", "/", "-", "\\"}

Functions

This section is empty.

Types

type Spinner

type Spinner struct {
	sync.Mutex
	Title     string
	Charset   []string
	FrameRate time.Duration

	Output io.Writer
	NoTty  bool
	// contains filtered or unexported fields
}

func StartNew

func StartNew(title string) *Spinner

start a new spinner, title can be an empty string

func (*Spinner) SetCharset

func (sp *Spinner) SetCharset(chars []string) *Spinner

set custom spinner character set

func (*Spinner) SetSpeed

func (sp *Spinner) SetSpeed(rate time.Duration) *Spinner

set custom spinner frame rate

func (*Spinner) Start

func (sp *Spinner) Start() *Spinner

start spinner

func (*Spinner) Stop

func (sp *Spinner) Stop()

stop and clear the spinner

Jump to

Keyboard shortcuts

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