progress

package
v0.0.0-...-df23a76 Latest Latest
Warning

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

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

Documentation

Overview

Package progress provides data and functionality to display updates to 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 NewSpinner

func NewSpinner() *Spinner

NewSpinner returns a spinner that outputs to stderr.

func (*Spinner) Events

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

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.

type Status

type Status string

Status is the condition of the progress update.

const (
	StatusInProgress Status = "In Progress"
	StatusFailed     Status = "Failed"
	StatusComplete   Status = "Complete"
	StatusSkipped    Status = "Skipped"
)

Common progression life-cycle for an update.

type TabRow

type TabRow string

TabRow represents a row in a table where columns are separated with a "\t" character.

type Text

type Text string

Text is a description of the progress update.

Directories

Path Synopsis
deploy
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