bytecounter

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteCounterReader

type ByteCounterReader struct {
	// contains filtered or unexported fields
}

func NewByteCounterReader

func NewByteCounterReader(reader io.ReadCloser) *ByteCounterReader

func (*ByteCounterReader) Bytes

func (b *ByteCounterReader) Bytes() int64

func (*ByteCounterReader) Close

func (b *ByteCounterReader) Close() error

func (*ByteCounterReader) Read

func (b *ByteCounterReader) Read(p []byte) (n int, err error)

func (*ByteCounterReader) SetCallback

func (b *ByteCounterReader) SetCallback(every time.Duration, cb func(full int64))

type StreamCopier

type StreamCopier interface {
	zfs.StreamCopier
	Count() int64
}

StreamCopier wraps a zfs.StreamCopier, reimplemening its interface and counting the bytes written to during copying.

func NewStreamCopier

func NewStreamCopier(sc zfs.StreamCopier) StreamCopier

NewStreamCopier wraps sc into a StreamCopier. If sc is io.Reader, it is guaranteed that the returned StreamCopier implements that interface, too.

Jump to

Keyboard shortcuts

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