progress

package
v0.1.59 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type             EventType
	TransferredBytes int64
	TotalBytes       int64
	Err              error
}

func NewEvent

func NewEvent(eventType EventType, transferredBytes int64, totalBytes int64, err error) *Event

type EventType

type EventType int
const (
	TransferStartedEvent EventType = iota
	TransferDataEvent
	TransferCompletedEvent
	TransferFailedEvent
)

type Listener

type Listener interface {
	ProgressChanged(event *Event)
}

type Request

type Request interface {
	SetProgressListener(progressListener Listener)
	GetProgressListener() Listener
	SetProgressInterval(progressInterval int64)
	GetProgressInterval() int64
}

type TeeReader

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

func NewTeeReader

func NewTeeReader(reader io.Reader, writer io.Writer, totalBytes int64, progressListener Listener, progressInterval int64) *TeeReader

func (*TeeReader) Close

func (r *TeeReader) Close() error

func (*TeeReader) Read

func (r *TeeReader) Read(p []byte) (int, error)

Jump to

Keyboard shortcuts

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