Name: ioprogress
Owner: CoreOS
Description: Go (golang) package for progress bars around io.Reader/Writers.
Created: 2015-04-30 21:49:21.0
Updated: 2018-01-30 16:39:01.0
Pushed: 2016-04-20 20:46:57.0
Homepage: null
Size: 146
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
ioprogress is a Go (golang) library with implementations of io.Reader
and io.Writer
that draws progress bars. The primary use case for these
are for CLI applications but alternate progress bar writers can be supplied
for alternate environments.
Standard go get
:
get github.com/mitchellh/ioprogress
Here is an example of outputting a basic progress bar to the CLI as
we're “downloading” from some other io.Reader
(perhaps from a network
connection):
magine this came from some external source, such as a network connection,
nd that we have the full size of it, such as from a Content-Length HTTP
eader.
r io.Reader
reate the progress reader
ressR := &ioprogress.Reader{
Reader: r,
Size: rSize,
opy all of the reader to some local file f. As it copies, the
rogressR will write progress to the terminal on os.Stdout. This is
ustomizable.
opy(f, progressR)