uilive

uilive 是一个用于实时更新终端输出的 go 库。「uilive is a go library for updating terminal output in realtime」

  • 所有者: gosuri/uilive
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

uilive GoDoc Build Status

uilive is a go library for updating terminal output in realtime. It provides a buffered io.Writer that is flushed at a timed interval. uilive powers uiprogress.

Usage Example

Calling uilive.New() will create a new writer. To start rendering, simply call writer.Start() and update the ui by writing to the writer. Full source for the below example is in example/main.go.

writer := uilive.New()
// start listening for updates and render
writer.Start()

for i := 0; i <= 100; i++ {
  fmt.Fprintf(writer, "Downloading.. (%d/%d) GB\n", i, 100)
  time.Sleep(time.Millisecond * 5)
}

fmt.Fprintln(writer, "Finished: Downloaded 100GB")
writer.Stop() // flush and stop rendering

The above will render

example

Installation

$ go get -v github.com/gosuri/uilive

主要指標

概覽
名稱與所有者gosuri/uilive
主編程語言Go
編程語言Go (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2015-11-16 06:13:10
推送於2023-07-22 11:29:29
最后一次提交2020-01-03 09:54:03
發布數4
最新版本名稱v0.0.4 (發布於 )
第一版名稱v0.0.1 (發布於 )
用户参与
星數1.7k
關注者數16
派生數88
提交數42
已啟用問題?
問題數18
打開的問題數7
拉請求數11
打開的拉請求數4
關閉的拉請求數9
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?