progressbar

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 3

README

progressbar

异步进度条打印

注意:
不支持 Windows 终端(cmd、powershell),但是可以在 git-for-windows 中正常使用

参考:
github.com/docker/docker/pkg/progress
github.com/docker/docker/pkg/jsonmessage
github.com/docker/docker/pkg/streamformatter

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format added in v1.0.1

func Format(fn func(p *Progress) []byte) formatFunc

Format .

func Percent added in v1.0.1

func Percent() formatFunc

Percent . style: 60%

func Symbol added in v1.0.1

func Symbol() formatFunc

Symbol . style: [==============================> ]

Types

type Progress

type Progress struct {
	// contains filtered or unexported fields
}

Progress .

func (*Progress) Incr added in v1.0.1

func (p *Progress) Incr(n uint)

Incr 增加当前进度

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader .

func NewReader

func NewReader(opts ...option) *Reader

NewReader . newLine: 是否从新行打印进度条

func (*Reader) Close

func (r *Reader) Close()

Close .

func (*Reader) NewProgress

func (r *Reader) NewProgress(id string, size uint) *Progress

NewProgress .

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL