spinner

package
v0.0.0-...-261ac86 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package spinner provides a simple wrapper around github.combriandowns/spinner to start and stop a spinner in the terminal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Spinner

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

Spinner represents an indicator that an asynchronous operation is taking place.

For short operations, less than 4 seconds, display only the spinner with the Start and Stop methods. For longer operations, display intermediate progress events using the Events method.

func New

func New() *Spinner

New returns a spinner that outputs to stderr.

func (*Spinner) Events

func (s *Spinner) Events(events []string)

Events writes additional information below the spinner while the spinner is still in progress. If there are already existing events under the spinner, it replaces them with the new information.

An event is displayed in a table, where columns are separated with the '\t' character.

func (*Spinner) Start

func (s *Spinner) Start(label string)

Start starts the spinner suffixed with a label.

func (*Spinner) Stop

func (s *Spinner) Stop(label string)

Stop stops the spinner and replaces it with a label.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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