command

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2020 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultUploadMaxAllParallel 默认所有文件并发上传数量,即可以同时并发上传多少个文件
	DefaultUploadMaxAllParallel = 1
	// DefaultUploadMaxRetry 默认上传失败最大重试次数
	DefaultUploadMaxRetry = 3
)

Variables

View Source
var (
	// MaxDownloadRangeSize 文件片段最大值
	MaxDownloadRangeSize = 55 * converter.MB

	// DownloadCacheSize 默认每个线程下载缓存大小
	DownloadCacheSize = 64 * converter.KB
)

Functions

func GetActivePanClient

func GetActivePanClient() *cloudpan.PanClient

func GetActiveUser

func GetActiveUser() *config.PanUser

func GetFileInfoByPaths

func GetFileInfoByPaths(paths ...string) (fileInfoList []*cloudpan.FileEntity, failedPaths []string, error error)

GetFileInfoByPaths 获取指定文件路径的文件详情信息

func RunChangeDirectory

func RunChangeDirectory(targetPath string)

func RunCopy

func RunCopy(paths ...string)

RunCopy 执行复制文件/目录

func RunDownload

func RunDownload(paths []string, options *DownloadOptions)

RunDownload 执行下载网盘内文件

func RunGetUserInfo

func RunGetUserInfo() (userInfo *cloudpan.UserInfo, error error)

func RunLogin

func RunLogin(username, password string) (usernameStr, passwordStr string, webToken cloudpan.WebLoginToken, appToken cloudpan.AppLoginToken, error error)

func RunLs

func RunLs(targetPath string, lsOptions *LsOptions, orderBy cloudpan.OrderBy, orderSort cloudpan.OrderSort)

func RunMkdir

func RunMkdir(name string)

func RunMove

func RunMove(paths ...string)

RunMove 执行移动文件/目录

func RunRemove

func RunRemove(paths ...string)

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

func RunRename

func RunRename(oldName string, newName string)

func RunShareCancel

func RunShareCancel(shareIDs []int64)

RunShareCancel 执行取消分享

func RunShareList

func RunShareList(page int)

RunShareList 执行列出分享列表

func RunShareSet

func RunShareSet(paths []string, expiredTime cloudpan.ShareExpiredTime)

RunShareSet 执行分享

func RunUpload

func RunUpload(localPaths []string, savePath string, opt *UploadOptions)

RunUpload 执行文件上传

func RunUserSign

func RunUserSign()

Types

type DownloadOptions

type DownloadOptions struct {
	IsPrintStatus        bool
	IsExecutedPermission bool
	IsOverwrite          bool
	SaveTo               string
	Parallel             int
	Load                 int
	MaxRetry             int
	NoCheck              bool
}

DownloadOptions 下载可选参数

type LocateDownloadOption

type LocateDownloadOption struct {
	FromPan bool
}

LocateDownloadOption 获取下载链接可选参数

type LsOptions

type LsOptions struct {
	Total bool
}

LsOptions 列目录可选项

type QuotaInfo

type QuotaInfo struct {
	// 已使用个人空间大小
	UsedSize int64
	// 个人空间总大小
	Quota int64
}

func RunGetQuotaInfo

func RunGetQuotaInfo() (quotaInfo *QuotaInfo, error error)

type SearchOptions

type SearchOptions struct {
	Total   bool
	Recurse bool
}

SearchOptions 搜索可选项

type UploadOptions

type UploadOptions struct {
	AllParallel   int // 所有文件并发上传数量,即可以同时并发上传多少个文件
	Parallel      int // 单个文件并发上传数量
	MaxRetry      int
	NoRapidUpload bool
	NoSplitFile   bool // 禁用分片上传
}

UploadOptions 上传可选项

Jump to

Keyboard shortcuts

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