| 59 | 59 |
}
|
| 60 | 60 |
}
|
| 61 | 61 |
|
| 62 | |
// BarDynamicTotal enables dynamic total behaviour.
|
|
62 |
// BarDynamicTotal is a flag, if set enables dynamic total behaviour.
|
|
63 |
// If provided total <= 0, it is set implicitly.
|
| 63 | 64 |
func BarDynamicTotal() BarOption {
|
| 64 | 65 |
return func(s *bState) {
|
| 65 | 66 |
s.dynamic = true
|
| 66 | 67 |
}
|
| 67 | 68 |
}
|
| 68 | 69 |
|
| 69 | |
// BarAutoIncrTotal auto increment total by amount, when trigger percentage remained till bar completion.
|
|
70 |
// BarAutoIncrTotal auto increment total by n, when trigger percentage remained till bar completion.
|
| 70 | 71 |
// In other words: say you've set trigger = 10, then auto increment will start after bar reaches 90 %.
|
| 71 | |
func BarAutoIncrTotal(trigger, amount int64) BarOption {
|
|
72 |
// Effective only if BarDynamicTotal option is set.
|
|
73 |
func BarAutoIncrTotal(trigger, n int64) BarOption {
|
| 72 | 74 |
return func(s *bState) {
|
| 73 | |
s.dynamic = true
|
| 74 | 75 |
s.totalAutoIncrTrigger = trigger
|
| 75 | |
s.totalAutoIncrBy = amount
|
|
76 |
s.totalAutoIncrBy = n
|
| 76 | 77 |
}
|
| 77 | 78 |
}
|
| 78 | 79 |
|
| 79 | |
// BarRemoveOnComplete is a flag, which will trigger bar auto remove on completion event.
|
|
80 |
// BarRemoveOnComplete is a flag, if set whole bar line will be removed on complete event.
|
|
81 |
// If both BarRemoveOnComplete and BarClearOnComplete are set, first bar section gets cleared
|
|
82 |
// and then whole bar line gets removed completely.
|
| 80 | 83 |
func BarRemoveOnComplete() BarOption {
|
| 81 | 84 |
return func(s *bState) {
|
| 82 | 85 |
s.removeOnComplete = true
|
|
| 91 | 94 |
}
|
| 92 | 95 |
}
|
| 93 | 96 |
|
| 94 | |
// BarClearOnComplete clears the bar section on complete event.
|
|
97 |
// BarClearOnComplete is a flag, if set will clear bar section on complete event.
|
|
98 |
// If you need to remove a whole bar line, refer to BarRemoveOnComplete.
|
| 95 | 99 |
func BarClearOnComplete() BarOption {
|
| 96 | 100 |
return func(s *bState) {
|
| 97 | |
s.noBarOnComplete = true
|
|
101 |
s.barClearOnComplete = true
|
| 98 | 102 |
}
|
| 99 | 103 |
}
|
| 100 | 104 |
|