summaryrefslogtreecommitdiffstats
path: root/dependencies/pkg/mod/github.com/vbauerster/mpb/v6@v6.0.4/bar_filler.go
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:36:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:36:04 +0000
commitb09c6d56832eb1718c07d74abf3bc6ae3fe4e030 (patch)
treed2caec2610d4ea887803ec9e9c3cd77136c448ba /dependencies/pkg/mod/github.com/vbauerster/mpb/v6@v6.0.4/bar_filler.go
parentInitial commit. (diff)
downloadicingadb-upstream.tar.xz
icingadb-upstream.zip
Adding upstream version 1.1.0.upstream/1.1.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dependencies/pkg/mod/github.com/vbauerster/mpb/v6@v6.0.4/bar_filler.go')
-rw-r--r--dependencies/pkg/mod/github.com/vbauerster/mpb/v6@v6.0.4/bar_filler.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/dependencies/pkg/mod/github.com/vbauerster/mpb/v6@v6.0.4/bar_filler.go b/dependencies/pkg/mod/github.com/vbauerster/mpb/v6@v6.0.4/bar_filler.go
new file mode 100644
index 0000000..c8cedaa
--- /dev/null
+++ b/dependencies/pkg/mod/github.com/vbauerster/mpb/v6@v6.0.4/bar_filler.go
@@ -0,0 +1,31 @@
+package mpb
+
+import (
+ "io"
+
+ "github.com/vbauerster/mpb/v6/decor"
+)
+
+// BarFiller interface.
+// Bar (without decorators) renders itself by calling BarFiller's Fill method.
+//
+// reqWidth is requested width, set by `func WithWidth(int) ContainerOption`.
+// If not set, it defaults to terminal width.
+//
+// Default implementations can be obtained via:
+//
+// func NewBarFiller(style string) BarFiller
+// func NewBarFillerRev(style string) BarFiller
+// func NewBarFillerPick(style string, rev bool) BarFiller
+// func NewSpinnerFiller(style []string, alignment SpinnerAlignment) BarFiller
+//
+type BarFiller interface {
+ Fill(w io.Writer, reqWidth int, stat decor.Statistics)
+}
+
+// BarFillerFunc is function type adapter to convert function into BarFiller.
+type BarFillerFunc func(w io.Writer, reqWidth int, stat decor.Statistics)
+
+func (f BarFillerFunc) Fill(w io.Writer, reqWidth int, stat decor.Statistics) {
+ f(w, reqWidth, stat)
+}