Documentation
¶
Index ¶
- type Downloader
- func (d *Downloader) Download(fileUrl, fileName string, force bool) (size int64, err error)
- func (d *Downloader) DownloadIfNot(fileUrl, fileName string) (int64, error)
- func (d *Downloader) DownloadIgnore(fileUrl, fileName string) (int64, error)
- func (d *Downloader) GetCheckConfig(fileUrl string) *pget.CheckConfig
- func (d *Downloader) GetConfig(fileUrl, savePath string) *pget.DownloadConfig
- func (d *Downloader) GetLength(fileUrl string) (int64, error)
- func (d *Downloader) GetLengthContext(ctx context.Context, fileUrl string) (int64, error)
- func (d *Downloader) GetSavePath(fileUrl, fileName string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Downloader ¶
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) GetLengthContext ¶
func (*Downloader) GetSavePath ¶
func (d *Downloader) GetSavePath(fileUrl, fileName string) string
Click to show internal directories.
Click to hide internal directories.