meter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2018 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Spinners = []string{"|", "(", "<", "-", "<", "(", "|", ")", ">", "-", ">", ")"}

Functions

This section is empty.

Types

type NoProgressMeter

type NoProgressMeter struct{}

NoProgressMeter is a `Progress` that doesn't actually report anything.

func (*NoProgressMeter) Add

func (p *NoProgressMeter) Add(int64)

func (*NoProgressMeter) Done

func (p *NoProgressMeter) Done()

func (*NoProgressMeter) Inc

func (p *NoProgressMeter) Inc()

func (*NoProgressMeter) Start

func (p *NoProgressMeter) Start(string)

type Progress

type Progress interface {
	Start(format string)
	Inc()
	Add(delta int64)
	Done()
}

Progress is an interface for a simple progress meter. Call `Start()` to begin reporting. `format` should include some kind of '%d' field, into which will be written the current count. A spinner and a CR character will be added automatically.

Call `Inc()` every time the quantity of interest increases. Call `Stop()` to stop reporting. After an instance's `Stop()` method has been called, it may be reused (starting at value 0) by calling `Start()` again.

func NewProgressMeter

func NewProgressMeter(period time.Duration) Progress

Jump to

Keyboard shortcuts

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