coreos/ioprogress

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ioprogress

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.

Example

Progress

Installation

Standard go get:

 get github.com/mitchellh/ioprogress
Usage

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)

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.