Documentation ¶
Overview ¶
Copyright (c) 2020 tickstep & chenall
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 tickstep.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func Backup(c *cli.Context) error
- func CmdBackup() cli.Command
- func CmdCd() cli.Command
- func CmdConfig() cli.Command
- func CmdCp() cli.Command
- func CmdDownload() cli.Command
- func CmdExport() cli.Command
- func CmdFamily() cli.Command
- func CmdImport() cli.Command
- func CmdLogin() cli.Command
- func CmdLoglist() cli.Command
- func CmdLogout() cli.Command
- func CmdLs() cli.Command
- func CmdMkdir() cli.Command
- func CmdMv() cli.Command
- func CmdPwd() cli.Command
- func CmdQuota() cli.Command
- func CmdRapidUpload() cli.Command
- func CmdRecycle() cli.Command
- func CmdRename() cli.Command
- func CmdRm() cli.Command
- func CmdShare() cli.Command
- func CmdSign() cli.Command
- func CmdSu() cli.Command
- func CmdTool() cli.Command
- func CmdUpload() cli.Command
- func CmdWho() cli.Command
- func CmdXcp() cli.Command
- func DelRemoteFileFromDB(familyId int64, localDir string, savePath string, flagSync bool)
- func GetActivePanClient() *cloudpan.PanClient
- func GetActiveUser() *config.PanUser
- func GetAppFileInfoByPaths(familyId int64, paths ...string) (fileInfoList []*cloudpan.AppFileEntity, failedPaths []string, error error)
- func GetFamilyCloudMark(familyId int64) string
- func GetFileInfoByPaths(paths ...string) (fileInfoList []*cloudpan.FileEntity, failedPaths []string, error error)
- func IsFamilyCloud(familyId int64) bool
- func OpenSyncDb(path string) (panupload.SyncDb, error)
- func RunChangeDirectory(familyId int64, targetPath string)
- func RunCopy(paths ...string)
- func RunDownload(paths []string, options *DownloadOptions)
- func RunExportFiles(familyId int64, overwrite bool, panPaths []string, saveLocalFilePath string)
- func RunGetUserInfo() (userInfo *cloudpan.UserInfo, error error)
- func RunImportFiles(familyId int64, overwrite bool, panSavePath, localFilePath string)
- func RunLogin(username, password string) (usernameStr, passwordStr string, webToken cloudpan.WebLoginToken, ...)
- func RunLs(familyId int64, targetPath string, lsOptions *LsOptions, ...)
- func RunMkdir(familyId int64, name string)
- func RunMove(familyId int64, paths ...string)
- func RunRapidUpload(familyId int64, isOverwrite bool, panFilePath string, md5Str string, ...)
- func RunRecycleClear()
- func RunRecycleDelete(fidStrList ...string)
- func RunRecycleList(page int)
- func RunRecycleRestore(fidStrList ...string)
- func RunRemove(familyId int64, paths ...string)
- func RunRename(familyId int64, oldName string, newName string)
- func RunShareCancel(shareIDs []int64)
- func RunShareList(page int)
- func RunShareSave(shareUrl, savePanDirPath string)
- func RunShareSet(paths []string, expiredTime cloudpan.ShareExpiredTime, ...)
- func RunSwitchFamilyList(targetFamilyId int64)
- func RunUpload(localPaths []string, savePath string, opt *UploadOptions)
- func RunUserSign()
- func RunXCopy(source FileSourceType, familyId int64, paths ...string)
- func WalkAllFile(dirPath string, walkFn filepath.WalkFunc) error
- type DownloadOptions
- type FileSourceType
- type ImportExportFileItem
- type LocateDownloadOption
- type LsOptions
- type QuotaInfo
- type SearchOptions
- type UploadOptions
Constants ¶
const ( // DefaultUploadMaxAllParallel 默认所有文件并发上传数量,即可以同时并发上传多少个文件 DefaultUploadMaxAllParallel = 1 // DefaultUploadMaxRetry 默认上传失败最大重试次数 DefaultUploadMaxRetry = 3 )
const (
DefaultSaveToPanPath = "/cloudpan189-go"
)
Variables ¶
var ( // MaxDownloadRangeSize 文件片段最大值 MaxDownloadRangeSize = 55 * converter.MB // DownloadCacheSize 默认每个线程下载缓存大小 DownloadCacheSize = 64 * converter.KB )
var ErrBadArgs = errors.New("参数错误")
var ErrNotLogined = errors.New("未登录账号")
var UploadFlags = []cli.Flag{ cli.IntFlag{ Name: "p", Usage: "本次操作文件上传并发数量,即可以同时并发上传多少个文件。0代表跟从配置文件设置", Value: 0, }, cli.IntFlag{ Name: "retry", Usage: "上传失败最大重试次数", Value: DefaultUploadMaxRetry, }, cli.BoolFlag{ Name: "np", Usage: "no progress 不展示上传进度条", }, cli.BoolFlag{ Name: "ow", Usage: "overwrite, 覆盖已存在的同名文件,注意已存在的文件会被移到回收站", }, cli.BoolFlag{ Name: "norapid", Usage: "不检测秒传", }, cli.StringFlag{ Name: "familyId", Usage: "家庭云ID", Value: "", }, cli.StringSliceFlag{ Name: "exn", Usage: "exclude name,指定排除的文件夹或者文件的名称,只支持正则表达式。支持同时排除多个名称,每一个名称就是一个exn参数", Value: nil, }, }
Functions ¶
func CmdDownload ¶
func CmdLoglist ¶
func CmdRapidUpload ¶
func CmdRecycle ¶
func DelRemoteFileFromDB ¶
删除那些本地不存在而网盘存在的网盘文件 默认使用本地数据库判断,如果 flagSync 为 true 则遍历网盘文件列表进行判断(速度较慢)。
func GetActivePanClient ¶
func GetActiveUser ¶
func GetAppFileInfoByPaths ¶
func GetAppFileInfoByPaths(familyId int64, paths ...string) (fileInfoList []*cloudpan.AppFileEntity, failedPaths []string, error error)
GetFileInfoByPaths 获取指定文件路径的文件详情信息
func GetFamilyCloudMark ¶
func GetFileInfoByPaths ¶
func GetFileInfoByPaths(paths ...string) (fileInfoList []*cloudpan.FileEntity, failedPaths []string, error error)
GetFileInfoByPaths 获取指定文件路径的文件详情信息
func IsFamilyCloud ¶
func RunChangeDirectory ¶
func RunExportFiles ¶
func RunGetUserInfo ¶
func RunImportFiles ¶
func RunLogin ¶
func RunLogin(username, password string) (usernameStr, passwordStr string, webToken cloudpan.WebLoginToken, appToken cloudpan.AppLoginToken, error error)
func RunRapidUpload ¶
func RunRecycleRestore ¶
func RunRecycleRestore(fidStrList ...string)
RunRecycleRestore 执行还原回收站文件或目录
func RunShareSave ¶
func RunShareSave(shareUrl, savePanDirPath string)
func RunShareSet ¶
func RunShareSet(paths []string, expiredTime cloudpan.ShareExpiredTime, shareMode cloudpan.ShareMode)
RunShareSet 执行分享
func RunSwitchFamilyList ¶
func RunSwitchFamilyList(targetFamilyId int64)
func RunUpload ¶
func RunUpload(localPaths []string, savePath string, opt *UploadOptions)
RunUpload 执行文件上传
func RunUserSign ¶
func RunUserSign()
func RunXCopy ¶
func RunXCopy(source FileSourceType, familyId int64, paths ...string)
RunXCopy 执行移动文件/目录
Types ¶
type DownloadOptions ¶
type DownloadOptions struct { IsPrintStatus bool IsExecutedPermission bool IsOverwrite bool SaveTo string Parallel int Load int MaxRetry int NoCheck bool ShowProgress bool FamilyId int64 }
DownloadOptions 下载可选参数
type FileSourceType ¶
type FileSourceType string
const ( // 个人云文件 PersonCloud FileSourceType = "person" // 家庭云文件 FamilyCloud FileSourceType = "family" )
type ImportExportFileItem ¶
type LocateDownloadOption ¶
type LocateDownloadOption struct {
FromPan bool
}
LocateDownloadOption 获取下载链接可选参数
type QuotaInfo ¶
func RunGetQuotaInfo ¶
type UploadOptions ¶
type UploadOptions struct { AllParallel int // 所有文件并发上传数量,即可以同时并发上传多少个文件 Parallel int // 单个文件并发上传数量 MaxRetry int NoRapidUpload bool NoSplitFile bool // 禁用分片上传 ShowProgress bool IsOverwrite bool // 覆盖已存在的文件,如果同名文件已存在则移到回收站里 FamilyId int64 ExcludeNames []string // 排除的文件名,包括文件夹和文件。即这些文件/文件夹不进行上传,支持正则表达式 }
UploadOptions 上传可选项