Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TrackProgress ¶
func TrackProgress(p ProgressReporter, total int, done chan<- bool)
TrackProgress monitors the passed ProgressReporter and draws a progress bar to stdout based on expected total. Due to a 1 second resolution it uses a channel to wake the parent goroutine once it finishes.
Types ¶
type ProgressReporter ¶
type ProgressReporter interface {
// GetProgress returns the totalProgress of the r/w interface
GetProgress() int
}
ProgressReporter is an interface implemented by progress-tracking readers and writers
type Reader ¶
type Reader struct {
// Reader is the underlying io.Reader to which all read calls are proxied.
io.Reader
// contains filtered or unexported fields
}
Reader extends io.Reader interface with a byte counter
func (*Reader) GetProgress ¶
GetProgress returns the total number of bytes read.
type Writer ¶
type Writer struct {
// Writer is the underlying io.Writer to which all read calls are proxied.
io.Writer
// contains filtered or unexported fields
}
Writer extends io.Writer interface with a byte counter
func (*Writer) GetProgress ¶
GetProgress returns the total number of bytes written.
Click to show internal directories.
Click to hide internal directories.