progressbar

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

README

progressbar

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Black

func Black(s string) string

func Blue

func Blue(s string) string

func Bold

func Bold(s string) string

func Cyan

func Cyan(s string) string

func Gray

func Gray(s string) string

func Green

func Green(s string) string

func Pink

func Pink(s string) string

func PrintBlack

func PrintBlack(s string)

func PrintBlue

func PrintBlue(s string)

func PrintBold

func PrintBold(s string)

func PrintCyan

func PrintCyan(s string)

func PrintGray

func PrintGray(s string)

func PrintGreen

func PrintGreen(s string)

func PrintPink

func PrintPink(s string)

func PrintRed

func PrintRed(s string)

func PrintWhite

func PrintWhite(s string)

func PrintYellow

func PrintYellow(s string)

func Red

func Red(s string) string

func SetColor

func SetColor(text string, conf, bg, color int) string

func White

func White(s string) string

func Yellow

func Yellow(s string) string

Types

type Bar

type Bar struct {
	StartDelimiter string // StartDelimiter for the bar ("|")
	EndDelimiter   string // EndDelimiter for the bar ("|")
	Filled         string // Filled section representation ("█ ■")
	Empty          string // Empty section representation ("░ □")
	Width          int    // Width of the bar
	Name           string // Name of the bar
	Prefix         string // Prefix of the bar
	// contains filtered or unexported fields
}

Bar is a progress bar

func NewBar

func NewBar(total int64) *Bar

NewBar return a new bar with the given total

func (*Bar) Add

func (b *Bar) Add(n int64)

Add the specified amount to the progressbar

func (*Bar) Close

func (b *Bar) Close()

Close the rate listen

func (*Bar) Render

func (b *Bar) Render(w io.Writer) int64

Render write the progress bar to io.Writer

func (*Bar) SetEmpty

func (b *Bar) SetEmpty(s string, color ...string)

SetEmpty set the empty value

func (*Bar) SetFilled

func (b *Bar) SetFilled(s string, color ...string)

SetFilled set the filled value

func (*Bar) SetName

func (b *Bar) SetName(s string, color ...string)

SetName set the prefix value

func (*Bar) SetPrefix

func (b *Bar) SetPrefix(s string, color ...string)

SetPrefix set the prefix value

func (*Bar) SetText

func (b *Bar) SetText(s string, color ...string)

SetText set the text value

func (*Bar) Write

func (b *Bar) Write(bytes []byte) (n int, err error)

Write implement io.Writer

Jump to

Keyboard shortcuts

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