go_spinner

package module
v0.0.0-...-eac0e0e Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: MIT Imports: 6 Imported by: 0

README

go-spinner

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 NewSpinner

func NewSpinner(title string) *Spinner

create spinner object

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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