spinners

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Spinner

type Spinner struct {
	IsDead bool
	// contains filtered or unexported fields
}

Spinner defines a single s

func (*Spinner) Done

func (s *Spinner) Done()

Done marks spinner as success

func (*Spinner) Error

func (s *Spinner) Error(err error)

Error marks spinner as error

func (*Spinner) ErrorWithMessage

func (s *Spinner) ErrorWithMessage(message string, err error)

ErrorWithMessage marks spinner as error and update message

func (*Spinner) IsActive

func (s *Spinner) IsActive() bool

func (*Spinner) Update

func (s *Spinner) Update(message string)

Update updates the spinner message

func (*Spinner) WithName

func (s *Spinner) WithName(name string) *Spinner

type SpinnerGroup

type SpinnerGroup struct {
	sync.Mutex
	sync.WaitGroup
	// contains filtered or unexported fields
}

SpinnerGroup is a group of Spinners

func NewSpinnerGroup

func NewSpinnerGroup() *SpinnerGroup

NewSpinnerGroup creates a SpinnerGroup

func NewSpinnerGroupWithSize

func NewSpinnerGroupWithSize(size int) *SpinnerGroup

NewSpinnerGroupWithSize creates a SpinnerGroup with size

func (*SpinnerGroup) AddSpinner

func (g *SpinnerGroup) AddSpinner() *SpinnerGroup

func (*SpinnerGroup) At

func (g *SpinnerGroup) At(idx int) *Spinner

At returns the Spinner at given 0-based index

func (*SpinnerGroup) Start

func (g *SpinnerGroup) Start(ctx context.Context)

Start the spinners

func (*SpinnerGroup) Stop

func (g *SpinnerGroup) Stop()

Stop the spinners

func (*SpinnerGroup) Wait

func (g *SpinnerGroup) Wait() error

Wait for all spinners to finish

Jump to

Keyboard shortcuts

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