progress

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

Reader is an io.Reader for checking progress.

func NewReader

func NewReader(rd io.Reader, total, current int64) *Reader

NewReader create a new io.Reader for checking progress.

func (*Reader) Current

func (r *Reader) Current() int64

func (*Reader) Err

func (r *Reader) Err() error

Err returns err.

func (*Reader) Finish

func (r *Reader) Finish(err error)

Finish finishes the progress check operation.

func (*Reader) Finished

func (r *Reader) Finished() <-chan struct{}

Finish sends notification when finished any progress.

func (*Reader) FractionCompleted

func (r *Reader) FractionCompleted() float64

FractionCompleted returns the fraction of the overall work completed by this progress struct, including work done by any children it may have.

func (*Reader) Read

func (r *Reader) Read(p []byte) (n int, err error)

Read reads data using underlying io.Reader. The number of bytes read is added to the current progress status.

Jump to

Keyboard shortcuts

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