progress

package
v0.0.0-...-fe7c145 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader struct {
	C chan *Tick
	// contains filtered or unexported fields
}

Reader is a progress-aware reader that communicates its results over channel C. Channel C can then be read for information about the progress of the copy.

func NewReader

func NewReader(artifact string, reader io.Reader, interval time.Duration) *Reader

NewReader creates a new reader for use, wrapping an io.Reader with a reporting duration and artifact information.

func (*Reader) Close

func (r *Reader) Close() error

Close closes the reader and channel.

func (*Reader) Read

func (r *Reader) Read(buf []byte) (int, error)

Read bytes from the reader, reporting progress to the channel as data arrives.

type Tick

type Tick struct {
	Value    uint64
	Time     time.Time
	Artifact string
}

Tick is the information supplied to the consumer when progress events arrive such as reaching an interval. The time of the event is also recorded.

Jump to

Keyboard shortcuts

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