urldownloader

package
v0.0.0-...-dcce029 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 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 PieceResult

type PieceResult struct {
	Downloader *URLDownloader
	Buffer     bufferpool.Buffer
	Index      uint32
	Error      error
	Done       bool
}

PieceResult wraps the downloaded piece data.

type URLDownloader

type URLDownloader struct {
	URL        string
	Begin, End uint32
	// contains filtered or unexported fields
}

URLDownloader downloads files from a HTTP source.

func New

func New(source string, begin, end uint32) *URLDownloader

New returns a new URLDownloader for the given source and piece range.

func (*URLDownloader) Close

func (d *URLDownloader) Close()

Close the URLDownloader.

func (*URLDownloader) ReadCurrent

func (d *URLDownloader) ReadCurrent() uint32

ReadCurrent returns the index of piece that is currently being downloaded.

func (*URLDownloader) Run

func (d *URLDownloader) Run(client *http.Client, pieces []piece.Piece, multifile bool, resultC chan interface{}, pool *bufferpool.Pool, readTimeout time.Duration)

Run the URLDownloader and download pieces.

func (*URLDownloader) String

func (d *URLDownloader) String() string

String returns the URL being downloaded.

func (*URLDownloader) UpdateEnd

func (d *URLDownloader) UpdateEnd(value uint32)

UpdateEnd updates the end index of the piece range being downloaded.

Jump to

Keyboard shortcuts

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