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 DotBaiduCom + const EmptyContentMD5 + const MaxRapidUploadSize + const MaxUploadBlockSize + const MinUploadBlockSize + const NetdiskUA + const OperationCloudDlAddTask + const OperationCloudDlCancelTask + const OperationCloudDlClearTask + const OperationCloudDlDeleteTask + const OperationCloudDlListTask + const OperationCloudDlQueryTask + const OperationCopy + const OperationDownloadFile + const OperationDownloadStreamFile + const OperationExportFileInfo + const OperationFilesDirectoriesList + const OperationFilesDirectoriesMeta + const OperationFixMD5 + const OperationGetRapidUploadInfo + const OperationGetUK + const OperationLocateDownload + const OperationLocatePanAPIDownload + const OperationMkdir + const OperationMove + const OperationQuotaInfo + const OperationRapidUpload + const OperationRecycleClear + const OperationRecycleDelete + const OperationRecycleList + const OperationRecycleRestore + const OperationRemove + const OperationRename + const OperationSearch + const OperationShareCancel + const OperationShareList + const OperationShareSURLInfo + const OperationShareSet + const OperationUpload + const OperationUploadCreateSuperFile + const OperationUploadPrecreate + const OperationUploadSuperfile2 + const OperationUploadTmpFile + const OperrationMatchPathByShellPattern + const OrderAsc + const OrderByName + const OrderBySize + const OrderByTime + const OrderDesc + const PCSBaiduCom + const PanAppID + const PanBaiduCom + const PathSeparator + const RecommendUploadBlockSize + const ShellPatternCharacters + const SliceMD5Size + const YunBaiduCom + var DefaultOrderOptions = &OrderOptions + var ErrContentRangeNotFound = errors.New("Content-Range not found") + var ErrFileTooLarge = errors.New("文件大于20GB, 无法秒传") + var ErrFixMD5Failed = errors.New("fix md5 failed") + var ErrFixMD5FileInfoNil = errors.New("file info is nil") + var ErrFixMD5Isdir = errors.New("directory not support fix md5") + var ErrGetRapidUploadInfoCrc32NotEqual = errors.New("x-bs-meta-crc32 不匹配") + var ErrGetRapidUploadInfoCrc32NotFound = errors.New("x-bs-meta-crc32 not found") + var ErrGetRapidUploadInfoFilenameNotEqual = errors.New("文件名不匹配") + var ErrGetRapidUploadInfoLengthNotEqual = errors.New("Content-Length 不匹配") + var ErrGetRapidUploadInfoLengthNotFound = errors.New("Content-Length not found") + var ErrGetRapidUploadInfoMD5NotEqual = errors.New("Content-MD5 不匹配") + var ErrGetRapidUploadInfoMD5NotFound = errors.New("Content-MD5 not found") + var ErrGetRapidUploadInfoSliceMD5NotEqual = errors.New("slice-md5 不匹配") + var ErrLocateDownloadURLNotFound = errors.New("locatedownload url not found") + var ErrMatchPathByShellPatternNotAbsPath = errors.New("not absolute path") + var ErrNilJSONValue = errors.New("json value is nil") + var ErrShareLinkNotFound = errors.New("未找到分享链接") + var ErrUploadMD5NotFound = errors.New("unknown response data, md5 not found") + var ErrUploadSavePathFound = errors.New("unknown response data, file saved path not found") + var ErrUploadSeqNotMatch = errors.New("服务器返回的上传队列不匹配") + var MaxDownloadRangeSize = 55 * converter.MB + var PublicSuffixList cookiejar.PublicSuffixList = list + func GetHTTPScheme(https bool) (scheme string) + type APIDownloadDlinkInfo struct + Dlink string + FsID string + type APIDownloadDlinkInfoList []*APIDownloadDlinkInfo + type BaiduPCS struct + func NewPCS(appID int, bduss string) *BaiduPCS + func NewPCSWithClient(appID int, client *requester.HTTPClient) *BaiduPCS + func NewPCSWithCookieStr(appID int, cookieStr string) *BaiduPCS + func (pcs *BaiduPCS) CacheFilesDirectoriesList(path string, options *OrderOptions) (fdl FileDirectoryList, pcsError pcserror.Error) + func (pcs *BaiduPCS) CloudDlAddTask(sourceURL, savePath string) (taskID int64, pcsError pcserror.Error) + func (pcs *BaiduPCS) CloudDlCancelTask(taskID int64) (pcsError pcserror.Error) + func (pcs *BaiduPCS) CloudDlClearTask() (total int, pcsError pcserror.Error) + func (pcs *BaiduPCS) CloudDlDeleteTask(taskID int64) (pcsError pcserror.Error) + func (pcs *BaiduPCS) CloudDlListTask() (cl CloudDlTaskList, pcsError pcserror.Error) + func (pcs *BaiduPCS) CloudDlQueryTask(taskIDs []int64) (cl CloudDlTaskList, pcsError pcserror.Error) + func (pcs *BaiduPCS) Copy(cpmvJSON ...*CpMvJSON) (pcsError pcserror.Error) + func (pcs *BaiduPCS) DownloadFile(path string, downloadFunc DownloadFunc) (err error) + func (pcs *BaiduPCS) DownloadStreamFile(path string, downloadFunc DownloadFunc) (err error) + func (pcs *BaiduPCS) ExportByFileInfo(finfo *FileDirectory) (rinfo *RapidUploadInfo, pcsError pcserror.Error) + func (pcs *BaiduPCS) FilesDirectoriesBatchMeta(paths ...string) (data FileDirectoryList, pcsError pcserror.Error) + func (pcs *BaiduPCS) FilesDirectoriesList(path string, options *OrderOptions) (data FileDirectoryList, pcsError pcserror.Error) + func (pcs *BaiduPCS) FilesDirectoriesMeta(path string) (data *FileDirectory, pcsError pcserror.Error) + func (pcs *BaiduPCS) FilesDirectoriesRecurseList(path string, options *OrderOptions, ...) (data FileDirectoryList) + func (pcs *BaiduPCS) FixMD5(pcspath string) (pcsError pcserror.Error) + func (pcs *BaiduPCS) FixMD5ByFileInfo(finfo *FileDirectory) (pcsError pcserror.Error) + func (pcs *BaiduPCS) GetBDUSS() (bduss string) + func (pcs *BaiduPCS) GetClient() *requester.HTTPClient + func (pcs *BaiduPCS) GetRapidUploadInfoByFileInfo(finfo *FileDirectory) (rinfo *RapidUploadInfo, pcsError pcserror.Error) + func (pcs *BaiduPCS) GetRapidUploadInfoByLink(link string, compareRInfo *RapidUploadInfo) (rinfo *RapidUploadInfo, pcsError pcserror.Error) + func (pcs *BaiduPCS) Isdir(pcspath string) (isdir bool, pcsError pcserror.Error) + func (pcs *BaiduPCS) LocateDownload(pcspath string) (info *URLInfo, pcsError pcserror.Error) + func (pcs *BaiduPCS) LocatePanAPIDownload(fidList ...int64) (dlinkInfoList APIDownloadDlinkInfoList, pcsError pcserror.Error) + func (pcs *BaiduPCS) MatchPathByShellPattern(pattern string) (pcspaths []string, pcsError pcserror.Error) + func (pcs *BaiduPCS) Mkdir(pcspath string) (pcsError pcserror.Error) + func (pcs *BaiduPCS) Move(cpmvJSON ...*CpMvJSON) (pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareCloudDlAddTask(sourceURL, savePath string) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareCloudDlCancelTask(taskID int64) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareCloudDlClearTask() (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareCloudDlDeleteTask(taskID int64) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareCloudDlListTask() (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareCloudDlQueryTask(taskIDs string) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareCopy(cpmvJSON ...*CpMvJSON) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareFilesDirectoriesBatchMeta(paths ...string) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareFilesDirectoriesList(path string, options *OrderOptions) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareLocateDownload(pcspath string) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareLocatePanAPIDownload(fidList ...int64) (dataReadCloser io.ReadCloser, panError pcserror.Error) + func (pcs *BaiduPCS) PrepareMkdir(pcspath string) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareMove(cpmvJSON ...*CpMvJSON) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareQuotaInfo() (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareRapidUpload(targetPath, contentMD5, sliceMD5, crc32 string, length int64) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareRecycleClear() (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareRecycleDelete(fidList ...int64) (dataReadCloser io.ReadCloser, panError pcserror.Error) + func (pcs *BaiduPCS) PrepareRecycleList(page int) (dataReadCloser io.ReadCloser, panError pcserror.Error) + func (pcs *BaiduPCS) PrepareRecycleRestore(fidList ...int64) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareRemove(paths ...string) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareRename(from, to string) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareSearch(targetPath, keyword string, recursive bool) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareShareCancel(shareIDs []int64) (dataReadCloser io.ReadCloser, panError pcserror.Error) + func (pcs *BaiduPCS) PrepareShareList(page int) (dataReadCloser io.ReadCloser, panError pcserror.Error) + func (pcs *BaiduPCS) PrepareSharePSet(paths []string, period int) (dataReadCloser io.ReadCloser, panError pcserror.Error) + func (pcs *BaiduPCS) PrepareShareSURLInfo(shareID int64) (dataReadCloser io.ReadCloser, panError pcserror.Error) + func (pcs *BaiduPCS) PrepareUK() (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareUpload(targetPath string, uploadFunc UploadFunc) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareUploadCreateSuperFile(checkDir bool, targetPath string, blockList ...string) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareUploadPrecreate(targetPath, contentMD5, sliceMD5, crc32 string, size int64, ...) (dataReadCloser io.ReadCloser, panError pcserror.Error) + func (pcs *BaiduPCS) PrepareUploadSuperfile2(uploadid, targetPath string, partseq int, partOffset int64, ...) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) PrepareUploadTmpFile(uploadFunc UploadFunc) (dataReadCloser io.ReadCloser, pcsError pcserror.Error) + func (pcs *BaiduPCS) QuotaInfo() (quota, used int64, pcsError pcserror.Error) + func (pcs *BaiduPCS) RapidUpload(targetPath, contentMD5, sliceMD5, crc32 string, length int64) (pcsError pcserror.Error) + func (pcs *BaiduPCS) RapidUploadNoCheckDir(targetPath, contentMD5, sliceMD5, crc32 string, length int64) (pcsError pcserror.Error) + func (pcs *BaiduPCS) RecycleClear() (sussNum int, pcsError pcserror.Error) + func (pcs *BaiduPCS) RecycleDelete(fidList ...int64) (panError pcserror.Error) + func (pcs *BaiduPCS) RecycleList(page int) (fdl RecycleFDInfoList, panError pcserror.Error) + func (pcs *BaiduPCS) RecycleRestore(fidList ...int64) (sussFsIDList []*FsIDJSON, pcsError pcserror.Error) + func (pcs *BaiduPCS) Remove(paths ...string) (pcsError pcserror.Error) + func (pcs *BaiduPCS) Rename(from, to string) (pcsError pcserror.Error) + func (pcs *BaiduPCS) Search(targetPath, keyword string, recursive bool) (fdl FileDirectoryList, pcsError pcserror.Error) + func (pcs *BaiduPCS) SetAPPID(appID int) + func (pcs *BaiduPCS) SetHTTPS(https bool) + func (pcs *BaiduPCS) SetPCSUserAgent(ua string) + func (pcs *BaiduPCS) SetPanUserAgent(ua string) + func (pcs *BaiduPCS) SetStoken(stoken string) + func (pcs *BaiduPCS) SetUID(uid uint64) + func (pcs *BaiduPCS) ShareCancel(shareIDs []int64) (pcsError pcserror.Error) + func (pcs *BaiduPCS) ShareList(page int) (records ShareRecordInfoList, pcsError pcserror.Error) + func (pcs *BaiduPCS) ShareSURLInfo(shareID int64) (info *ShareSURLInfo, pcsError pcserror.Error) + func (pcs *BaiduPCS) ShareSet(paths []string, option *ShareOption) (s *Shared, pcsError pcserror.Error) + func (pcs *BaiduPCS) UK() (uk int64, pcsError pcserror.Error) + func (pcs *BaiduPCS) URL() *url.URL + func (pcs *BaiduPCS) Upload(targetPath string, uploadFunc UploadFunc) (pcsError pcserror.Error) + func (pcs *BaiduPCS) UploadCreateSuperFile(checkDir bool, targetPath string, blockList ...string) (pcsError pcserror.Error) + func (pcs *BaiduPCS) UploadPrecreate(targetPath, contentMD5, sliceMD5, crc32 string, size int64, ...) (precreateInfo *PrecreateInfo, pcsError pcserror.Error) + func (pcs *BaiduPCS) UploadSuperfile2(uploadid, targetPath string, partseq int, partOffset int64, ...) (md5sum string, pcsError pcserror.Error) + func (pcs *BaiduPCS) UploadTmpFile(uploadFunc UploadFunc) (md5 string, pcsError pcserror.Error) + type BlockListJSON struct + BlockList []string + type CloudDlFileInfo struct + FileName string + FileSize int64 + type CloudDlTaskInfo struct + CreateTime int64 + FileList []*CloudDlFileInfo + FileSize int64 + FinishTime int64 + FinishedSize int64 + OdType int + Result int + SavePath string + SourceURL string + StartTime int64 + Status int + StatusText string + TaskID int64 + TaskName string + func (ci *CloudDlTaskInfo) ParseText() + type CloudDlTaskList []*CloudDlTaskInfo + func (cl CloudDlTaskList) String() string + type CpMvJSON struct + From string + To string + func (cj *CpMvJSON) JSON() (data []byte, err error) + type CpMvJSONList []*CpMvJSON + func (cjl *CpMvJSONList) AllRelatedDir() (dirs []string) + type CpMvListJSON struct + List CpMvJSONList + func (clj *CpMvListJSON) JSON() (data []byte, err error) + func (clj *CpMvListJSON) String() string + type DownloadFunc func(downloadURL string, jar http.CookieJar) error + type FileDirectory struct + AppID int64 + Children FileDirectoryList + Ctime int64 + Filename string + FsID int64 + Ifhassubdir bool + Isdir bool + MD5 string + Mtime int64 + Parent *FileDirectory + Path string + Size int64 + func (f *FileDirectory) String() string + type FileDirectoryList []*FileDirectory + func (fl FileDirectoryList) AllFilePaths() (pcspaths []string) + func (fl FileDirectoryList) Count() (fileN, directoryN int64) + func (fl FileDirectoryList) TotalSize() int64 + type FsIDJSON struct + FsID int64 + type FsIDListJSON struct + List []*FsIDJSON + type HandleFileDirectoryFunc func(depth int, fdPath string, fd *FileDirectory, pcsError pcserror.Error) bool + type LocateDownloadInfoV1 struct + Server []string + type Order string + type OrderBy string + type OrderOptions struct + By OrderBy + Order Order + type PathJSON struct + Path string + type PathsListJSON struct + List []*PathJSON + func (plj *PathsListJSON) JSON(paths ...string) (data []byte, err error) + type PrecreateInfo struct + IsRapidUpload bool + UploadID string + UploadSeqList []*UploadSeq + type RapidUploadInfo struct + ContentCrc32 string + ContentLength int64 + ContentMD5 string + Filename string + SliceMD5 string + type RecycleClearInfo struct + List RecycleFDInfoList + SussNum int + type RecycleFDInfo struct + Ctime int64 + Filename string + FsID int64 + Isdir int + LeftTime int + MD5 string + Mtime int64 + Path string + Size int64 + type RecycleFDInfoList []*RecycleFDInfo + type ShareOption struct + Password string + Period int + type ShareRecordInfo struct + FsIds []int64 + Passwd string + Public int + ShareID int64 + Shortlink string + Status int + TypicalCategory int + TypicalPath string + type ShareRecordInfoList []*ShareRecordInfo + type ShareSURLInfo struct + Pwd string + ShortURL string + type Shared struct + Link string + ShareID int64 + type URLInfo struct + URLs []struct{ ... } + func (ui *URLInfo) LastURL(https bool) *url.URL + func (ui *URLInfo) SingleURL(https bool) *url.URL + func (ui *URLInfo) URLStrings(https bool) (urls []*url.URL) + type UploadFunc func(uploadURL string, jar http.CookieJar) (resp *http.Response, err error) + type UploadSeq struct + Block string + Seq int