Documentation ¶
Overview ¶
Package pcscommand 命令包
Index ¶
- Constants
- Variables
- func GetActiveUser() *pcsconfig.Baidu
- func GetBaiduPCS() *baidupcs.BaiduPCS
- func RunBgDownload(paths []string, options *DownloadOptions)
- func RunChangeDirectory(path 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(targetPath string, blockList ...string)
- func RunDownload(paths []string, options *DownloadOptions)
- func RunExport(pcspaths []string, rootPath string)
- func RunGetMeta(path string)
- func RunGetQuota()
- func RunLocateDownload(pcspaths ...string)
- func RunLogin(username, password string) (bduss, ptoken, stoken string, err error)
- func RunLs(path string, lsOptions *LsOptions, orderOptions *baidupcs.OrderOptions)
- func RunMkdir(path string)
- func RunMove(paths ...string)
- func RunRapidUpload(targetPath, contentMD5, sliceMD5, crc32 string, length int64)
- func RunRemove(paths ...string)
- func RunSearch(targetPath, keyword string, opt *SearchOptions)
- func RunShareCancel(shareIDs []int64)
- func RunShareList()
- func RunShareSet(paths []string, option *baidupcs.ShareOption)
- func RunTree(path string)
- func RunUpload(localPaths []string, savePath string, opt *UploadOptions)
- type BgDTaskItem
- type BgTasks
- type DownloadOptions
- type ListTask
- type LsOptions
- type Runner
- type SearchOptions
- type StepUpload
- type UploadOptions
Constants ¶
View Source
const ( //DownloadSuffix 文件下载后缀 DownloadSuffix = ".BaiduPCS-Go-downloading" //StrDownloadInitError 初始化下载发生错误 StrDownloadInitError = "初始化下载发生错误" // DefaultDownloadMaxRetry 默认下载失败最大重试次数 DefaultDownloadMaxRetry = 3 )
View Source
const (
// DefaultUploadMaxRetry 默认上传失败最大重试次数
DefaultUploadMaxRetry = 3
)
Variables ¶
View Source
var ( // ErrNotSupportChecksum 文件不支持校验 ErrNotSupportChecksum = errors.New("该文件不支持校验") // ErrChecksumFailed 文件校验失败 ErrChecksumFailed = errors.New("该文件校验失败, 文件md5值与服务器记录的不匹配") )
View Source
var ( // BgMap 后台 BgMap = BgTasks{ // contains filtered or unexported fields } )
View Source
var ( // DefaultRunner 默认 Runner DefaultRunner = Runner{ Output: os.Stdout, } )
Functions ¶
func RunBgDownload ¶
func RunBgDownload(paths []string, options *DownloadOptions)
RunBgDownload 执行后台下载
func RunChangeDirectory ¶
RunChangeDirectory 执行更改工作目录
func RunCloudDlAddTask ¶
RunCloudDlAddTask 执行添加离线下载任务
func RunCloudDlCancelTask ¶
func RunCloudDlCancelTask(taskIDs []int64)
RunCloudDlCancelTask 取消离线下载任务
func RunCloudDlDeleteTask ¶
func RunCloudDlDeleteTask(taskIDs []int64)
RunCloudDlDeleteTask 删除离线下载任务
func RunCreateSuperFile ¶
RunCreateSuperFile 执行分片上传—合并分片文件
func RunLs ¶
func RunLs(path string, lsOptions *LsOptions, orderOptions *baidupcs.OrderOptions)
RunLs 执行列目录
func RunRapidUpload ¶
RunRapidUpload 执行秒传文件, 前提是知道文件的大小, md5, 前256KB切片的 md5, crc32
func RunSearch ¶
func RunSearch(targetPath, keyword string, opt *SearchOptions)
func RunUpload ¶
func RunUpload(localPaths []string, savePath string, opt *UploadOptions)
RunUpload 执行文件上传
Types ¶
type BgDTaskItem ¶
type BgDTaskItem struct {
// contains filtered or unexported fields
}
BgDTaskItem 后台任务详情
type DownloadOptions ¶
type DownloadOptions struct { IsTest bool IsPrintStatus bool IsExecutedPermission bool IsOverwrite bool IsLocateDownload bool IsStreaming bool SaveTo string Parallel int Load int MaxRetry int NoCheck bool Out io.Writer }
DownloadOptions 下载可选参数
type ListTask ¶
type ListTask struct { ID int // 任务id MaxRetry int // 最大重试次数 // contains filtered or unexported fields }
ListTask 队列状态 (基类)
type SearchOptions ¶
type StepUpload ¶
type StepUpload int
StepUpload 上传步骤
const ( // StepUploadInit 初始化步骤 StepUploadInit StepUpload = iota // StepUploadRapidUpload 秒传步骤 StepUploadRapidUpload // StepUploadUpload 正常上传步骤 StepUploadUpload )
Click to show internal directories.
Click to hide internal directories.