progress

package
v1.0.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2017 License: Apache-2.0, CC-BY-SA-4.0 Imports: 5 Imported by: 0

Documentation

Overview

Package progress assists in displaying human readable progress information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bar

type Bar float64

Bar provides a very simple progress bar implementation.

Use with fmt.Printf and "r" to format the progress bar. A "-" flag makes it progress from right to left.

func (Bar) Format

func (h Bar) Format(state fmt.State, r rune)

type Bytes

type Bytes int64

Bytes converts a regular int64 to human readable type.

func (Bytes) String

func (b Bytes) String() string

type BytesPerSecond

type BytesPerSecond int64

func NewBytesPerSecond

func NewBytesPerSecond(n int64, duration time.Duration) BytesPerSecond

func (BytesPerSecond) String

func (bps BytesPerSecond) String() string

type Writer

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

Writer buffers writes until flush, at which time the last screen is cleared and the current buffer contents are written. This is useful for implementing progress displays, such as those implemented in docker and git.

func NewWriter

func NewWriter(w io.Writer) *Writer

func (*Writer) Flush

func (w *Writer) Flush() error

Flush should be called when refreshing the current display.

func (*Writer) Write

func (w *Writer) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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