progressbar

package
v2.0.3+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2019 License: Apache-2.0 Imports: 1 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PassThru

type PassThru struct {
	io.ReadCloser
	Total *chan int64 // Total # of bytes transferred
}

PassThru wraps an existing io.Reader.

It simply forwards the Read() call, while displaying the results from individual calls to it.

func (*PassThru) Close

func (pt *PassThru) Close() error

Close overrides underlying io.ReadCloser Close method

func (*PassThru) Read

func (pt *PassThru) Read(p []byte) (int, error)

Read 'overrides' the underlying io.ReadCloser's Read method. This is the one that will be called by io.Copy(). We simply use it to keep track of byte counts and then forward the call.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL