spinner

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package spinner provides a terminal spinner/loader

Index

Constants

This section is empty.

Variables

View Source
var Prefix = []string{
	"",
	"\x1b[36mfetching\x1b[m ",
	"\x1b[36mprocessing\x1b[m ",
	"\x1b[36mdownloading\x1b[m ",
}

list of spinner prefixes.

Functions

This section is empty.

Types

type Spinner

type Spinner struct {
	Delay  time.Duration // Delay is the speed of the spinner
	Prefix string        // Prefix string that will be prepended to the spinner
	Color  colors.Color  // Color of the spinner
	// contains filtered or unexported fields
}

Spinner config.

func Default

func Default(p string) *Spinner

Default is a wrapper around NewSpinner with predefined spinner color and time delay options.

func NewSpinner

func NewSpinner(prefix string, color colors.Color, d time.Duration) *Spinner

NewSpinner returns a pointer to Spinner instance with provided options.

func (*Spinner) Start

func (s *Spinner) Start()

Start activates the spinner.

func (*Spinner) Stop

func (s *Spinner) Stop()

Stop deactivates the spinner.

Jump to

Keyboard shortcuts

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