progress

package
v0.0.0-...-d7093dc Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package progress show the progress bar when deal some busy things, and can register new bar then wait all bars finished.

Index

Constants

This section is empty.

Variables

View Source
var MaxSteps = 10000

MaxSteps define the max steps for a bar.

Functions

This section is empty.

Types

type WaitingBar

type WaitingBar struct {
	sync.WaitGroup
}

WaitingBar extend the wait group, and register a new bar then call Wait() method to wait all bars to finished.

func (*WaitingBar) AddBar

func (waitingBar *WaitingBar) AddBar(barName string, steps int) chan<- int

AddBar add a new bar, then return a notifer channel that can report the progress back, then progress bar will be updated in another goroutine.

func (*WaitingBar) Start

func (*WaitingBar) Start()

Start method start show the progress bar

func (*WaitingBar) Stop

func (*WaitingBar) Stop()

Stop method stop the progress bar

Jump to

Keyboard shortcuts

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