Documentation ¶
Overview ¶
Package pcscommand 命令包
Index ¶
- Constants
- Variables
- func GetActiveUser() *pcsconfig.Baidu
- func GetBaiduPCS() *baidupcs.BaiduPCS
- func GetExportFilename() string
- func RunChangeDirectory(targetPath string, isList bool)
- func RunCloudDlAddTask(sourceURLs []string, savePath string)
- func RunCloudDlCancelTask(taskIDs []int64)
- func RunCloudDlClearTask()
- func RunCloudDlDeleteTask(taskIDs []int64)
- func RunCloudDlListTask()
- func RunCloudDlQueryTask(taskIDs []int64)
- func RunCopy(paths ...string)
- func RunCreateSuperFile(policy string, targetPath string, blockList ...string)
- func RunDownload(paths []string, options *DownloadOptions)
- func RunExport(pcspaths []string, opt *ExportOptions)
- func RunFixMD5(pcspaths ...string)
- func RunGetMeta(targetPaths ...string)
- func RunGetQuota()
- func RunLocateDownload(pcspaths []string, opt *LocateDownloadOption)
- func RunLogin(username, password string) (bduss, ptoken, stoken string, cookies string, err error)
- func RunLs(pcspath string, lsOptions *LsOptions, orderOptions *baidupcs.OrderOptions)
- func RunMkdir(path string)
- func RunMove(paths ...string)
- func RunRapidTransfer(link string, rnameOpt ...bool)
- func RunRapidUpload(targetPath, contentMD5, sliceMD5 string, length int64)
- func RunRecycleClear()
- func RunRecycleDelete(fidStrList ...string)
- func RunRecycleList(page int)
- func RunRecycleRestore(fidStrList ...string)
- func RunRemove(paths ...string)
- func RunSearch(targetPath, keyword string, opt *SearchOptions)
- func RunShareCancel(shareIDs []int64)
- func RunShareList(page int)
- func RunShareSet(paths []string, option *baidupcs.ShareOption)
- func RunShareTransfer(params []string, opt *baidupcs.TransferOption)
- func RunTestShellPattern(pattern string)
- func RunTree(path string, depth int, option *TreeOptions)
- func RunUpload(localPaths []string, savePath string, opt *UploadOptions)
- type DownloadOptions
- type ExportOptions
- type ListTask
- type LocateDownloadOption
- type LsOptions
- type Runner
- type SearchOptions
- type TreeOptions
- type UploadOptions
Constants ¶
View Source
const (
// DefaultUploadMaxRetry 默认上传失败最大重试次数
DefaultUploadMaxRetry = 3
)
Variables ¶
View Source
var ( // ErrShellPatternMultiRes 多条通配符匹配结果 ErrShellPatternMultiRes = errors.New("多条通配符匹配结果") // ErrShellPatternNoHit 未匹配到路径 ErrShellPatternNoHit = errors.New("未匹配到路径, 请检测通配符") )
View Source
var ( // DefaultRunner 默认 Runner DefaultRunner = Runner{ Output: os.Stdout, } )
Functions ¶
func RunChangeDirectory ¶
RunChangeDirectory 执行更改工作目录
func RunCloudDlAddTask ¶
RunCloudDlAddTask 执行添加离线下载任务
func RunCloudDlCancelTask ¶
func RunCloudDlCancelTask(taskIDs []int64)
RunCloudDlCancelTask 取消离线下载任务
func RunCloudDlDeleteTask ¶
func RunCloudDlDeleteTask(taskIDs []int64)
RunCloudDlDeleteTask 删除离线下载任务
func RunCreateSuperFile ¶
RunCreateSuperFile 执行分片上传—预上传文件及合并分片文件
func RunLocateDownload ¶
func RunLocateDownload(pcspaths []string, opt *LocateDownloadOption)
RunLocateDownload 执行获取直链
func RunLs ¶
func RunLs(pcspath string, lsOptions *LsOptions, orderOptions *baidupcs.OrderOptions)
RunLs 执行列目录
func RunRapidTransfer ¶
RunRapidTransfer 执行秒传链接解析及保存
func RunRapidUpload ¶
RunRapidUpload 执行秒传文件, 前提是知道文件的大小, md5, 前256KB切片的 md5, crc32
func RunRecycleRestore ¶
func RunRecycleRestore(fidStrList ...string)
RunRecycleRestore 执行还原回收站文件或目录
func RunShareTransfer ¶
func RunShareTransfer(params []string, opt *baidupcs.TransferOption)
RunShareTransfer 执行分享链接转存到网盘
func RunUpload ¶
func RunUpload(localPaths []string, savePath string, opt *UploadOptions)
RunUpload 执行文件上传
Types ¶
type DownloadOptions ¶
type DownloadOptions struct { IsTest bool IsPrintStatus bool IsExecutedPermission bool IsOverwrite bool DownloadMode pcsdownload.DownloadMode SaveTo string Parallel int Load int MaxRetry int NoCheck bool ModifyMTime bool FullPath bool LinkPrefer int }
DownloadOptions 下载可选参数
type ExportOptions ¶
type ExportOptions struct { RootPath string // 根路径 SavePath string // 输出路径 MaxRetry int Recursive bool LinkFormat bool StdOut bool }
ExportOptions 导出可选项
type ListTask ¶
type ListTask struct { ID int // 任务id MaxRetry int // 最大重试次数 // contains filtered or unexported fields }
ListTask 队列状态 (基类)
type LocateDownloadOption ¶
type LocateDownloadOption struct {
FromPan bool
}
LocateDownloadOption 获取下载链接可选参数
type TreeOptions ¶
Click to show internal directories.
Click to hide internal directories.