Codebase list golang-github-vbauerster-mpb / 852f912
README update Vladimir Bauer 5 years ago
1 changed file(s) with 11 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
77
88 ## Features
99
10 * __Multiple Bars__: Multiple progress bars are supported
11 * __Dynamic Total__: Set total while bar is running
12 * __Dynamic Add/Remove__: Dynamically add or remove bars
13 * __Cancellation__: Cancel whole rendering process
14 * __Predefined Decorators__: Elapsed time, [ewma](https://github.com/VividCortex/ewma) based ETA, Percentage, Bytes counter
15 * __Decorator's width sync__: Synchronized decorator's width among multiple bars
10 - **Multiple Bars**: Multiple progress bars are supported
11 - **Dynamic Total**: Set total while bar is running
12 - **Dynamic Add/Remove**: Dynamically add or remove bars
13 - **Cancellation**: Cancel whole rendering process
14 - **Predefined Decorators**: Elapsed time, [ewma](https://github.com/VividCortex/ewma) based ETA, Percentage, Bytes counter
15 - **Decorator's width sync**: Synchronized decorator's width among multiple bars
1616
1717 ## Usage
1818
1919 #### [Rendering single bar](_examples/singleBar/main.go)
20
2021 ```go
2122 package main
2223
3536 total := 100
3637 name := "Single Bar:"
3738 // adding a single bar, which will inherit container's width
38 bar := p.AddBar(int64(total),
39 // override DefaultBarStyle, which is "[=>-]<+"
40 mpb.BarStyle("╢▌▌░╟"),
39 bar := p.Add(int64(total),
40 // progress bar filler with customized style
41 mpb.NewBarFiller("╢▌▌░╟"),
4142 mpb.PrependDecorators(
4243 // display our name with one space on the right
4344 decor.Name(name, decor.WC{W: len(name) + 1, C: decor.DidentRight}),
6061 ```
6162
6263 #### [Rendering multiple bars](_examples/multiBars/main.go)
64
6365 ```go
6466 var wg sync.WaitGroup
6567 // pass &wg (optional), so p will wait for it eventually