spinner

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DefaultFrameRate = time.Millisecond * 150
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Spinner

type Spinner struct {
	sync.Mutex
	Title     string
	Template  template.Template
	FrameRate time.Duration

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

func New

func New(title string) *Spinner

NewSpinner creates a Spinner with default template and FrameRate

func StartNew

func StartNew(title string) *Spinner

StartNew creates a Spinner with default template and FrameRate. after create Spinner, starts the execution.

func (*Spinner) Error

func (s *Spinner) Error(err error)

Error gives error feedback for users and stops the spinner execution

func (*Spinner) SetSpeed

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

SetSpeed sets the frame rate execution

func (*Spinner) SetTemplate

func (s *Spinner) SetTemplate(template template.Template) *Spinner

SetTemplate sets the spinner template

func (*Spinner) Start

func (s *Spinner) Start() *Spinner

Start starts the spinner execution

func (*Spinner) Stop

func (s *Spinner) Stop()

Stop stops the spinner execution

func (*Spinner) Success

func (s *Spinner) Success(msg string)

Success gives success feedback for users and stops the spinner execution

Jump to

Keyboard shortcuts

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