ioprogress

Go (golang) package for progress bars around io.Reader/Writers.

  • 所有者: mitchellh/ioprogress
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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:

$ go 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):

// Imagine this came from some external source, such as a network connection,
// and that we have the full size of it, such as from a Content-Length HTTP
// header.
var r io.Reader

// Create the progress reader
progressR := &ioprogress.Reader{
	Reader: r,
	Size:   rSize,
}

// Copy all of the reader to some local file f. As it copies, the
// progressR will write progress to the terminal on os.Stdout. This is
// customizable.
io.Copy(f, progressR)

主要指标

概览
名称与所有者mitchellh/ioprogress
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2014-12-06 22:04:04
推送于2021-10-30 02:37:19
最后一次提交2018-01-31 16:47:57
发布数0
用户参与
星数501
关注者数11
派生数33
提交数20
已启用问题?
问题数2
打开的问题数1
拉请求数4
打开的拉请求数1
关闭的拉请求数1
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?