progress

package
v0.0.0-...-b817d74 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ProgressFormats = []Format{

		Format{
			Fill:  []string{"▓", "█"},
			Empty: "░",
		},

		Format{
			Fill:  []string{"⬤"},
			Empty: "◯",
		},

		Format{
			Fill:  []string{"■"},
			Empty: "□",
		},

		Format{
			Fill:  []string{"⚫"},
			Empty: "⚪",
		},

		Format{
			Fill:  []string{"▰"},
			Empty: "▱",
		},

		Format{
			Fill:  []string{"⬛"},
			Empty: "⬜",
		},

		Format{
			Fill:  []string{"⡀", "⡄", "⡆", "⡇", "⡏", "⡟", "⡿", "⣿"},
			Empty: "⣀",
		},

		Format{
			Fill:     []string{"="},
			Head:     ">",
			LeftEnd:  "[",
			RightEnd: "]",
			Empty:    " ",
		},

		Format{
			Fill:  []string{"▏", "▎", "▍", "▌", "▋", "▊", "▉"},
			Empty: " ",
		},
	}
)

Functions

This section is empty.

Types

type Format

type Format struct {
	Fill     []string
	Head     string
	Empty    string
	LeftEnd  string
	RightEnd string
}

type ProgressBar

type ProgressBar struct {
	Format

	Out   io.Writer //where to write
	Width int       //width of the bar

	Stop bool
	// contains filtered or unexported fields
}

func New

func New(total int) *ProgressBar

func (*ProgressBar) Add

func (p *ProgressBar) Add(n int) bool

func (*ProgressBar) Busy

func (p *ProgressBar) Busy(times int)

func (*ProgressBar) Cls

func (p *ProgressBar) Cls()

func (*ProgressBar) Finish

func (p *ProgressBar) Finish()

func (*ProgressBar) Inc

func (p *ProgressBar) Inc() bool

func (*ProgressBar) Read

func (pb *ProgressBar) Read(p []byte) (n int, err error)

implement io.Reader

func (*ProgressBar) Set

func (p *ProgressBar) Set(to int) bool

func (*ProgressBar) Write

func (pb *ProgressBar) Write(p []byte) (n int, err error)

satisfies io.Writer interface

Jump to

Keyboard shortcuts

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