pcscommand

package
v3.3.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2018 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package pcscommand 命令包

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPCSInfo

func GetPCSInfo() *baidupcs.BaiduPCS

GetPCSInfo 重载并返回 PCS 配置信息

func ReloadIfInConsole

func ReloadIfInConsole()

ReloadIfInConsole 程序在 Console 模式下才会重载配置

func ReloadInfo

func ReloadInfo()

ReloadInfo 重载配置

func RunChangeDirectory

func RunChangeDirectory(path string, isList bool)

RunChangeDirectory 执行更改工作目录

func RunCloudDlAddTask

func RunCloudDlAddTask(sourceURLs []string, savePath string)

RunCloudDlAddTask 执行添加离线下载任务

func RunCloudDlCancelTask

func RunCloudDlCancelTask(taskIDs []int64)

RunCloudDlCancelTask 取消离线下载任务

func RunCloudDlDeleteTask

func RunCloudDlDeleteTask(taskIDs []int64)

RunCloudDlDeleteTask 删除离线下载任务

func RunCloudDlListTask

func RunCloudDlListTask()

RunCloudDlListTask 查询离线下载任务列表

func RunCloudDlQueryTask

func RunCloudDlQueryTask(taskIDs []int64)

RunCloudDlQueryTask 精确查询离线下载任务

func RunCopy

func RunCopy(paths ...string)

RunCopy 执行 批量拷贝文件/目录

func RunDownload

func RunDownload(testing bool, parallel int, paths []string)

RunDownload 执行下载网盘内文件

func RunGetMeta

func RunGetMeta(path string)

RunGetMeta 执行 获取单个文件/目录的元信息

func RunGetQuota

func RunGetQuota()

RunGetQuota 执行 获取当前用户空间配额信息, 并输出

func RunLogin

func RunLogin(username, password string) (bduss, ptoken, stoken string, err error)

RunLogin 登录百度帐号

func RunLs

func RunLs(path string)

RunLs 执行列目录

func RunMkdir

func RunMkdir(path string)

RunMkdir 执行 创建目录

func RunMove

func RunMove(paths ...string)

RunMove 执行 批量 重命名/移动 文件/目录

func RunRapidUpload

func RunRapidUpload(targetPath, contentMD5, sliceMD5, crc32 string, length int64)

RunRapidUpload 执行秒传文件, 前提是知道文件的大小, md5, 前256KB切片的 md5, crc32

func RunRemove

func RunRemove(paths ...string)

RunRemove 执行 批量删除文件/目录

func RunUpload

func RunUpload(localPaths []string, savePath string)

RunUpload 执行文件上传

Types

type ListTask

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

ListTask 队列状态 (基类)

type LocalPathInfo

type LocalPathInfo struct {
	Path string // 本地路径

	Length   int64  // 文件大小
	SliceMD5 []byte // 文件前 requiredSliceLen (256KB) 切片的 md5 值
	MD5      []byte // 文件的 md5
	CRC32    uint32 // 文件的 crc32
	// contains filtered or unexported fields
}

LocalPathInfo 本地文件详情

func GetFileSum

func GetFileSum(localPath string, opt *SumOption) (lp *LocalPathInfo, err error)

GetFileSum 获取文件的大小, md5, 前256KB切片的 md5, crc32

func (*LocalPathInfo) Close

func (lp *LocalPathInfo) Close() error

Close 关闭文件

func (*LocalPathInfo) Crc32Sum

func (lp *LocalPathInfo) Crc32Sum()

Crc32Sum 获取文件的 crc32 值

func (*LocalPathInfo) Md5Sum

func (lp *LocalPathInfo) Md5Sum()

Md5Sum 获取文件的 md5 值

func (*LocalPathInfo) OpenPath

func (lp *LocalPathInfo) OpenPath() bool

OpenPath 检查文件状态并获取文件的大小 (Length)

func (*LocalPathInfo) SliceMD5Sum

func (lp *LocalPathInfo) SliceMD5Sum()

SliceMD5Sum 获取文件前 requiredSliceLen (256KB) 切片的 md5 值

func (*LocalPathInfo) Sum

func (lp *LocalPathInfo) Sum(opt SumOption)

Sum 计算文件摘要值

type SumOption

type SumOption struct {
	IsMD5Sum      bool
	IsSliceMD5Sum bool
	IsCRC32Sum    bool
}

SumOption 计算文件摘要值配置

Jump to

Keyboard shortcuts

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