diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2020-04-07 12:09:48 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2020-04-07 12:09:48 +0200 |
commit | 42fcdbf1a85c8e23ccc25a0e7e66b3a51b8f11dd (patch) | |
tree | 3344313b57b160a877044f56eec3d8e3c1c1669c /vendor/github.com/vbauerster/mpb/v4/proxyreader.go | |
parent | 64b6a197339e0436168e254ef9caf674ee9ff932 (diff) | |
download | podman-42fcdbf1a85c8e23ccc25a0e7e66b3a51b8f11dd.tar.gz podman-42fcdbf1a85c8e23ccc25a0e7e66b3a51b8f11dd.tar.bz2 podman-42fcdbf1a85c8e23ccc25a0e7e66b3a51b8f11dd.zip |
vendor c/image v5.4.2
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/github.com/vbauerster/mpb/v4/proxyreader.go')
-rw-r--r-- | vendor/github.com/vbauerster/mpb/v4/proxyreader.go | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/vendor/github.com/vbauerster/mpb/v4/proxyreader.go b/vendor/github.com/vbauerster/mpb/v4/proxyreader.go deleted file mode 100644 index 0e4b51f09..000000000 --- a/vendor/github.com/vbauerster/mpb/v4/proxyreader.go +++ /dev/null @@ -1,41 +0,0 @@ -package mpb - -import ( - "io" - "time" -) - -type proxyReader struct { - io.ReadCloser - bar *Bar - iT time.Time -} - -func (prox *proxyReader) Read(p []byte) (n int, err error) { - n, err = prox.ReadCloser.Read(p) - if n > 0 { - prox.bar.IncrBy(n, time.Since(prox.iT)) - prox.iT = time.Now() - } - if err == io.EOF { - go prox.bar.SetTotal(0, true) - } - return -} - -type proxyWriterTo struct { - *proxyReader - wt io.WriterTo -} - -func (prox *proxyWriterTo) WriteTo(w io.Writer) (n int64, err error) { - n, err = prox.wt.WriteTo(w) - if n > 0 { - prox.bar.IncrInt64(n, time.Since(prox.iT)) - prox.iT = time.Now() - } - if err == io.EOF { - go prox.bar.SetTotal(0, true) - } - return -} |