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
派生数89
提交数42
已启用问题?
问题数19
打开的问题数8
拉请求数11
打开的拉请求数4
关闭的拉请求数9
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?