downloader

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Downloader

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

func New_Downloader

func New_Downloader() *Downloader

func (*Downloader) DownloadFile

func (D *Downloader) DownloadFile(ctx context.Context, tmpdir string, url string, callback func(context.Context, chan int64, int64, *ReaderWithCounter)) (*os.File, error)

type Progress

type Progress struct {
	Transferred int64
	Size        int64
	Speed       int64
	TimeUnit    time.Duration
}

type ReaderWithCounter

type ReaderWithCounter struct {
	io.Reader
	Transferred int64
}

func (*ReaderWithCounter) Read

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

Jump to

Keyboard shortcuts

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