progress

package
v3.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package progress provides a simple terminal progress bar.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 ("░")
	Total          float64 // Total value.
	Width          int     // Width of the bar.
	// contains filtered or unexported fields
}

Bar is a progress bar.

func New

func New(total float64) *Bar

New returns a new bar with the given total.

func NewInt

func NewInt(total int) *Bar

NewInt returns a new bar with the given total.

func (*Bar) String

func (b *Bar) String() string

String returns the progress bar.

func (*Bar) Template

func (b *Bar) Template(s string)

Template for rendering. This method will panic if the template fails to parse.

func (*Bar) Text

func (b *Bar) Text(s string)

Text sets the text value.

func (*Bar) Value

func (b *Bar) Value(n float64)

Value sets the value.

func (*Bar) ValueInt

func (b *Bar) ValueInt(n int)

ValueInt sets the value.

func (*Bar) WriteTo

func (b *Bar) WriteTo(w io.Writer) (int64, error)

WriteTo writes the progress bar to w.

Jump to

Keyboard shortcuts

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