transfer

package
v0.0.0-...-493bf59 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteSize

type ByteSize float64
const (
	KB ByteSize = 1 << (10 * iota)
	MB
	GB
	TB
)

func (ByteSize) String

func (b ByteSize) String() string

type ReaderTransfer

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

ReaderTransfer monitors how much of a reader has been read

func NewReaderTransfer

func NewReaderTransfer(reader io.Reader, length int) *ReaderTransfer

NewReaderTransfer instantiates a ReadTransfer struct

func (*ReaderTransfer) Length

func (rt *ReaderTransfer) Length() ByteSize

func (*ReaderTransfer) Read

func (rt *ReaderTransfer) Read(p []byte) (int, error)

func (*ReaderTransfer) Transferred

func (rt *ReaderTransfer) Transferred() ByteSize

type Transfer

type Transfer interface {
	Transferred() ByteSize
	Length() ByteSize
}

type WriteCloserTransfer

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

WriteCloserTransfer monitors how much of a WriteCloser has been written

func NewWriteCloserTransfer

func NewWriteCloserTransfer(writeCloser io.WriteCloser, length int) *WriteCloserTransfer

NewWriteCloserTransfer instantiates a new WriteCloserTransfer

func (*WriteCloserTransfer) Close

func (wct *WriteCloserTransfer) Close() error

func (*WriteCloserTransfer) Length

func (wct *WriteCloserTransfer) Length() ByteSize

func (*WriteCloserTransfer) Transferred

func (wct *WriteCloserTransfer) Transferred() ByteSize

func (*WriteCloserTransfer) Write

func (wct *WriteCloserTransfer) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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