Documentation
¶
Overview ¶
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.
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 CmdDownload() cli.Command
- func CmdDrive() cli.Command
- func CmdExport() 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 CmdSu() cli.Command
- func CmdToken() cli.Command
- func CmdTool() cli.Command
- func CmdUpload() cli.Command
- func CmdWebdav() cli.Command
- func CmdWho() cli.Command
- func DelRemoteFileFromDB(driveId string, localDir string, savePath string, flagSync bool)
- func EscapeStr(s string) string
- func GetActivePanClient() *aliyunpan.PanClient
- func GetActiveUser() *config.PanUser
- func GetAllPathFolderByPath(pathStr string) []string
- func GetAppFileInfoByPaths(driveId string, paths ...string) (fileInfoList []*aliyunpan.FileEntity, failedPaths []string, error error)
- func GetFileInfoByPaths(paths ...string) (fileInfoList []*aliyunpan.FileEntity, failedPaths []string, error error)
- func OpenSyncDb(path string) (panupload.SyncDb, error)
- func RandomStr(count int) string
- func RunChangeDirectory(driveId, targetPath string)
- func RunDownload(paths []string, options *DownloadOptions)
- func RunExportFiles(driveId string, overwrite bool, panPaths []string, saveLocalFilePath string)
- func RunGetUserInfo() (userInfo *aliyunpan.UserInfo, error error)
- func RunImportFiles(driveId string, overwrite bool, panSavePath, localFilePath string)
- func RunLogin(refreshToken string) (refreshTokenStr string, webToken aliyunpan.WebLoginToken, error error)
- func RunLs(driveId, targetPath string, lsOptions *LsOptions)
- func RunMkdir(driveId, name string)
- func RunMove(driveId string, paths ...string)
- func RunRapidUpload(driveId string, isOverwrite bool, fileMetaList []string, savePanPath string)
- func RunRecycleClear(driveId string)
- func RunRecycleDelete(driveId string, fidStrList ...string)
- func RunRecycleList(driveId string)
- func RunRecycleRestore(driveId string, fidStrList ...string)
- func RunRemove(driveId string, paths ...string)
- func RunRename(driveId string, oldName string, newName string)
- func RunShareCancel(shareIdList []string)
- func RunShareList()
- func RunShareMc(driveId string, hideRelativePath bool, panPaths []string)
- func RunShareSet(driveId string, paths []string, expiredTime string, sharePwd string)
- func RunSwitchDriveList(targetDriveId string)
- func RunTokenUpdate(modeFlag string)
- func RunUpload(localPaths []string, savePath string, opt *UploadOptions)
- func UnescapeStr(s string) string
- func WalkAllFile(dirPath string, walkFn filepath.WalkFunc) error
- type DownloadOptions
- type LocateDownloadOption
- type LsOptions
- type QuotaInfo
- type RapidUploadItem
- type SearchOptions
- type UploadOptions
Constants ¶
const ( // DefaultUploadMaxAllParallel 默认所有文件并发上传数量,即可以同时并发上传多少个文件 DefaultUploadMaxAllParallel = 1 // DefaultUploadMaxRetry 默认上传失败最大重试次数 DefaultUploadMaxRetry = 3 )
const ( // 备份数据库桶分区标志 BackupMetaBucketName = "adrive" // 备份数据文件夹目录名称,隐藏目录 BackupMetaDirName = ".adrive" )
const (
DefaultSaveToPanPath = "/aliyunpan"
)
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: "driveId", Usage: "网盘ID", Value: "", }, cli.StringSliceFlag{ Name: "exn", Usage: "exclude name,指定排除的文件夹或者文件的名称,只支持正则表达式。支持同时排除多个名称,每一个名称就是一个exn参数", Value: nil, }, cli.IntFlag{ Name: "bs", Usage: "block size,上传分片大小,单位KB。推荐值:1024 ~ 10240", Value: 10240, }, }
Functions ¶
func CmdDownload ¶
func CmdLoglist ¶
func CmdRapidUpload ¶
func CmdRecycle ¶
func DelRemoteFileFromDB ¶
删除那些本地不存在而网盘存在的网盘文件 默认使用本地数据库判断,如果 flagSync 为 true 则遍历网盘文件列表进行判断(速度较慢)。
func GetActivePanClient ¶
func GetActiveUser ¶
func GetAllPathFolderByPath ¶ added in v0.0.5
func GetAppFileInfoByPaths ¶
func GetAppFileInfoByPaths(driveId string, paths ...string) (fileInfoList []*aliyunpan.FileEntity, failedPaths []string, error error)
GetFileInfoByPaths 获取指定文件路径的文件详情信息
func GetFileInfoByPaths ¶
func GetFileInfoByPaths(paths ...string) (fileInfoList []*aliyunpan.FileEntity, failedPaths []string, error error)
GetFileInfoByPaths 获取指定文件路径的文件详情信息
func RunChangeDirectory ¶
func RunChangeDirectory(driveId, targetPath string)
func RunExportFiles ¶
func RunGetUserInfo ¶
func RunImportFiles ¶
func RunLogin ¶
func RunLogin(refreshToken string) (refreshTokenStr string, webToken aliyunpan.WebLoginToken, error error)
func RunRapidUpload ¶
RunRapidUpload 秒传
func RunRecycleDelete ¶
RunRecycleDelete 执行删除回收站文件或目录
func RunRecycleRestore ¶
RunRecycleRestore 执行还原回收站文件或目录
func RunShareSet ¶
RunShareSet 执行分享
func RunSwitchDriveList ¶
func RunSwitchDriveList(targetDriveId string)
func RunUpload ¶
func RunUpload(localPaths []string, savePath string, opt *UploadOptions)
RunUpload 执行文件上传
Types ¶
type DownloadOptions ¶
type DownloadOptions struct {
IsPrintStatus bool
IsExecutedPermission bool
IsOverwrite bool
SaveTo string
Parallel int
Load int
MaxRetry int
NoCheck bool
ShowProgress bool
DriveId string
UseInternalUrl bool // 是否使用内置链接
}
DownloadOptions 下载可选参数
type LocateDownloadOption ¶
type LocateDownloadOption struct {
FromPan bool
}
LocateDownloadOption 获取下载链接可选参数
type QuotaInfo ¶
func RunGetQuotaInfo ¶
type RapidUploadItem ¶
秒传数据项
type UploadOptions ¶
type UploadOptions struct {
AllParallel int // 所有文件并发上传数量,即可以同时并发上传多少个文件
Parallel int // 单个文件并发上传数量
MaxRetry int
NoRapidUpload bool
ShowProgress bool
IsOverwrite bool // 覆盖已存在的文件,如果同名文件已存在则移到回收站里
DriveId string
ExcludeNames []string // 排除的文件名,包括文件夹和文件。即这些文件/文件夹不进行上传,支持正则表达式
BlockSize int64 // 分片大小
UseInternalUrl bool // 是否使用内置链接
}
UploadOptions 上传可选项