Versions in this module Expand all Collapse all v1 v1.0.3 May 3, 2020 v1.0.2 May 2, 2020 Changes in this version + const DefaultDownloadMaxRetry + const DefaultPrintFormat + const DownloadSuffix + const StrDownloadChecksumFailed + const StrDownloadFailed + const StrDownloadGetDlinkFailed + const StrDownloadInitError + var ErrDlinkNotFound = errors.New("未取得下载链接") + var ErrDownloadChecksumFailed = errors.New("该文件校验失败, 文件md5值与服务器记录的不匹配") + var ErrDownloadFileBanned = errors.New("该文件可能是违规文件, 不支持校验") + var ErrDownloadNotSupportChecksum = errors.New("该文件不支持校验") + var ErrShareInfoNotFound = errors.New("未在已分享列表中找到分享信息") + func BaiduPCSURLCheckFunc(client *requester.HTTPClient, durl string) (contentLength int64, resp *http.Response, err error) + func CheckFileValid(filePath string, fileInfo *baidupcs.FileDirectory) error + func FileExist(path string) bool + func FixHTTPLinkURL(linkURL *url.URL) + func GetLocateDownloadLinks(pcs *baidupcs.BaiduPCS, pcspath string) (dlinks []*url.URL, err error) + func IsSkipMd5Checksum(size int64, md5Str string) bool + type DownloadMode int + const DownloadModeLocate + const DownloadModePCS + const DownloadModeStreaming + type DownloadStatistic struct + type DownloadTaskUnit struct + Cfg *downloader.Config + DownloadMode DownloadMode + DownloadStatistic *DownloadStatistic + IsExecutedPermission bool + IsOverwrite bool + IsPrintStatus bool + NoCheck bool + PCS *baidupcs.BaiduPCS + ParentTaskExecutor *taskframework.TaskExecutor + PcsPath string + PrintFormat string + SavePath string + VerbosePrinter *pcsverbose.PCSVerbose + func (dtu *DownloadTaskUnit) OnComplete(lastRunResult *taskframework.TaskUnitRunResult) + func (dtu *DownloadTaskUnit) OnFailed(lastRunResult *taskframework.TaskUnitRunResult) + func (dtu *DownloadTaskUnit) OnRetry(lastRunResult *taskframework.TaskUnitRunResult) + func (dtu *DownloadTaskUnit) OnSuccess(lastRunResult *taskframework.TaskUnitRunResult) + func (dtu *DownloadTaskUnit) RetryWait() time.Duration + func (dtu *DownloadTaskUnit) Run() (result *taskframework.TaskUnitRunResult) + func (dtu *DownloadTaskUnit) SetTaskInfo(info *taskframework.TaskInfo)