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
用户参与
星數500
關注者數11
派生數33
提交數20
已啟用問題?
問題數2
打開的問題數1
拉請求數4
打開的拉請求數1
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?