summaryrefslogtreecommitdiff
path: root/vendor/github.com/vbauerster/mpb/v6/bar_filler.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2021-03-15 14:52:43 -0500
committerbaude <bbaude@redhat.com>2021-03-25 08:43:51 -0500
commitb5f54a9b23e8d9418700494da9aa78d8db354c43 (patch)
tree59dfb9edf3faf6d184f6af40522f71968948133a /vendor/github.com/vbauerster/mpb/v6/bar_filler.go
parenta861f6fd3ebe4fe0b63a1b550e6b99d7525228c0 (diff)
downloadpodman-b5f54a9b23e8d9418700494da9aa78d8db354c43.tar.gz
podman-b5f54a9b23e8d9418700494da9aa78d8db354c43.tar.bz2
podman-b5f54a9b23e8d9418700494da9aa78d8db354c43.zip
introduce podman machine
podman machine allows podman to create, manage, and interact with a vm running some form of linux (default is fcos). podman is then configured to be able to interact with the vm automatically. while this is usable on linux, the real push is to get this working on both current apple architectures in macos. Ashley Cui contributed to this PR and was a great help. [NO TESTS NEEDED] Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'vendor/github.com/vbauerster/mpb/v6/bar_filler.go')
-rw-r--r--vendor/github.com/vbauerster/mpb/v6/bar_filler.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/vendor/github.com/vbauerster/mpb/v6/bar_filler.go b/vendor/github.com/vbauerster/mpb/v6/bar_filler.go
new file mode 100644
index 000000000..c8cedaa4a
--- /dev/null
+++ b/vendor/github.com/vbauerster/mpb/v6/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)
+}