progress

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: BSD-3-Clause 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 {
	*Tracker
	io.Reader
}

func (*Reader) Read

func (rdr *Reader) Read(p []byte) (int, error)

TODO: If TotalReported is set before we start reading, report that figure before the first read.

type Tracker

type Tracker struct {
	FileSize int64
	Fn       func(int64)

	TotalReported int64
	Err           error
	IsClosed      bool
	sync.Mutex
	// contains filtered or unexported fields
}

func NewTracker

func NewTracker(fn func(int64), fileSize int64) *Tracker

TODO: panic on FileSize==0?

func (*Tracker) Close

func (tra *Tracker) Close() error

func (*Tracker) NewReader

func (tra *Tracker) NewReader(orig io.Reader) io.ReadCloser

func (*Tracker) NewWriter

func (tra *Tracker) NewWriter(orig io.WriteSeeker) WriteSeekCloser

func (*Tracker) SetOverhead

func (tra *Tracker) SetOverhead(over int64)

type WriteSeekCloser

type WriteSeekCloser interface {
	io.WriteSeeker
	io.Closer
}

type Writer

type Writer struct {
	*Tracker
	io.WriteSeeker
	// contains filtered or unexported fields
}

func (*Writer) Seek

func (wri *Writer) Seek(off int64, whence int) (int64, error)

func (*Writer) Write

func (wri *Writer) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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