mirror of
https://github.com/minio/minio.git
synced 2024-12-28 08:05:55 -05:00
18 lines
229 B
Go
18 lines
229 B
Go
|
package pb
|
||
|
|
||
|
import (
|
||
|
"io"
|
||
|
)
|
||
|
|
||
|
// It's proxy reader, implement io.Reader
|
||
|
type Reader struct {
|
||
|
io.Reader
|
||
|
bar *ProgressBar
|
||
|
}
|
||
|
|
||
|
func (r *Reader) Read(p []byte) (n int, err error) {
|
||
|
n, err = r.Reader.Read(p)
|
||
|
r.bar.Add(n)
|
||
|
return
|
||
|
}
|