transfer

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: LGPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Downloader

type Downloader struct {
	*http.Client
	// contains filtered or unexported fields
}

func NewDownloader

func NewDownloader(dirname string, procs int) *Downloader

func (*Downloader) Download

func (d *Downloader) Download(fileUrl, fileName string, force bool) (size int64, err error)

Download 下载文件到指定位置

func (*Downloader) DownloadIfNot

func (d *Downloader) DownloadIfNot(fileUrl, fileName string) (int64, error)

DownloadIfNot 下载文件到指定位置,如果不存在

func (*Downloader) DownloadIgnore

func (d *Downloader) DownloadIgnore(fileUrl, fileName string) (int64, error)

DownloadIgnore 下载文件到指定位置,同名文件存在时会被覆盖

func (*Downloader) GetCheckConfig

func (d *Downloader) GetCheckConfig(fileUrl string) *pget.CheckConfig

func (*Downloader) GetConfig

func (d *Downloader) GetConfig(fileUrl, savePath string) *pget.DownloadConfig

func (*Downloader) GetLength

func (d *Downloader) GetLength(fileUrl string) (int64, error)

func (*Downloader) GetLengthContext

func (d *Downloader) GetLengthContext(ctx context.Context, fileUrl string) (int64, error)

func (*Downloader) GetSavePath

func (d *Downloader) GetSavePath(fileUrl, fileName string) string

Jump to

Keyboard shortcuts

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