downloader

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: MulanPSL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadUrl

func DownloadUrl(ctx context.Context, url string, storagePath string) error

下载一个文件到本地路径 @param url 链接地址 @param storagePath 保存地址

Types

type SplitDownload

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

分片文件下载 @author fuzeyu

func (*SplitDownload) ErrNotFoundLength

func (this *SplitDownload) ErrNotFoundLength() bool

检查是否没在header头中获取到文件大小

func (*SplitDownload) Execute

func (this *SplitDownload) Execute() error

执行下载

func (*SplitDownload) Init

func (this *SplitDownload) Init(url string, filePath string) *SplitDownload

初始化 @param url 下载路径 @param filePath 本地文件地址 @param workingNumber 工作数量

Jump to

Keyboard shortcuts

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