Documentation ¶
Overview ¶
电脑手机客户端API,例如MAC客户端
WEB网页端API
Index ¶
- Constants
- func GetCaptchaImage() (savePath string, error *apierror.ApiError)
- func RefreshCookieToken(sessionKey string) string
- type AccessCount
- type ActivityTaskId
- type AppCheckBatchTaskResult
- type AppCopyFileParam
- type AppCreateBatchTaskResult
- type AppCreateUploadFileParam
- type AppCreateUploadFileResult
- type AppFamilyInfo
- type AppFamilyInfoListResult
- type AppFileDownloadRange
- type AppFileEntity
- type AppFileList
- type AppFileListParam
- type AppFileListResult
- type AppFileUploadRange
- type AppGetFileInfoParam
- type AppGetFileInfoResult
- type AppGetUploadFileStatusResult
- type AppLoginToken
- type AppMkdirResult
- type AppMoveFileResult
- type AppOrderBy
- type AppUploadFileCommitResult
- type AppUserSignResult
- type AppUserSignStatus
- type BatchTaskInfo
- type BatchTaskInfoList
- type BatchTaskParam
- type BatchTaskStatus
- type BatchTaskType
- type CheckTaskResult
- type DownloadFuncCallback
- type FileEntity
- type FileList
- type FileListParam
- type FileSearchParam
- type FileSearchResult
- type HandleAppFileDirectoryFunc
- type HandleFileDirectoryFunc
- type MediaType
- type MkdirResult
- type OrderBy
- type OrderSort
- type PanClient
- func (p *PanClient) AppCheckBatchTask(typeFlag BatchTaskType, taskId string) (result *CheckTaskResult, error *apierror.ApiError)
- func (p *PanClient) AppCopyFile(param *AppCopyFileParam) (*AppFileEntity, *apierror.ApiError)
- func (p *PanClient) AppCreateBatchTask(familyId int64, param *BatchTaskParam) (taskId string, error *apierror.ApiError)
- func (p *PanClient) AppCreateUploadFile(param *AppCreateUploadFileParam) (*AppCreateUploadFileResult, *apierror.ApiError)
- func (p *PanClient) AppDeleteFile(fileIdList []string) (bool, *apierror.ApiError)
- func (p *PanClient) AppDownloadFileData(downloadFileUrl string, fileRange AppFileDownloadRange, ...) *apierror.ApiError
- func (p *PanClient) AppFamilyCreateUploadFile(param *AppCreateUploadFileParam) (*AppCreateUploadFileResult, *apierror.ApiError)
- func (p *PanClient) AppFamilyDownloadFileData(downloadFileUrl string, fileRange AppFileDownloadRange, ...) *apierror.ApiError
- func (p *PanClient) AppFamilyGetFamilyList() (*AppFamilyInfoListResult, *apierror.ApiError)
- func (p *PanClient) AppFamilyGetFileDownloadUrl(familyId int64, fileId string) (string, *apierror.ApiError)
- func (p *PanClient) AppFamilyGetUploadFileStatus(familyId int64, uploadFileId string) (*AppGetUploadFileStatusResult, *apierror.ApiError)
- func (p *PanClient) AppFamilyMoveFile(familyId int64, fileId string, destParentId string) (*AppFileEntity, *apierror.ApiError)
- func (p *PanClient) AppFamilyRenameFile(familyId int64, renameFileId, newName string) (*AppFileEntity, *apierror.ApiError)
- func (p *PanClient) AppFamilySaveFileToPersonCloud(familyId int64, familyFileIdList []string) (bool, *apierror.ApiError)
- func (p *PanClient) AppFamilyUploadFileCommit(familyId int64, uploadCommitUrl, uploadFileId, xRequestId string) (*AppUploadFileCommitResult, *apierror.ApiError)
- func (p *PanClient) AppFamilyUploadFileData(familyId int64, uploadUrl, uploadFileId, xRequestId string, ...) *apierror.ApiError
- func (p *PanClient) AppFileInfoById(familyId int64, fileId string) (fileInfo *AppFileEntity, error *apierror.ApiError)
- func (p *PanClient) AppFileInfoByPath(familyId int64, pathStr string) (fileInfo *AppFileEntity, error *apierror.ApiError)
- func (p *PanClient) AppFileList(param *AppFileListParam) (*AppFileListResult, *apierror.ApiError)
- func (p *PanClient) AppFilePathById(familyId int64, fileId string) (string, *apierror.ApiError)
- func (p *PanClient) AppFilesDirectoriesRecurseList(familyId int64, path string, ...) AppFileList
- func (p *PanClient) AppGetAllFileList(param *AppFileListParam) (*AppFileListResult, *apierror.ApiError)
- func (p *PanClient) AppGetBasicFileInfo(param *AppGetFileInfoParam) (*AppGetFileInfoResult, *apierror.ApiError)
- func (p *PanClient) AppGetFileDownloadUrl(fileId string) (string, *apierror.ApiError)
- func (p *PanClient) AppGetUploadFileStatus(uploadFileId string) (*AppGetUploadFileStatusResult, *apierror.ApiError)
- func (p *PanClient) AppMkdir(familyId int64, parentFileId, dirName string) (*AppMkdirResult, *apierror.ApiError)
- func (p *PanClient) AppMkdirRecursive(familyId int64, parentFileId string, fullPath string, index int, ...) (*AppMkdirResult, *apierror.ApiError)
- func (p *PanClient) AppMoveFile(fileIdList []string, targetFolderId string) (*AppMoveFileResult, *apierror.ApiError)
- func (p *PanClient) AppRenameFile(renameFileId, newName string) (*AppFileEntity, *apierror.ApiError)
- func (p *PanClient) AppSaveFileToFamilyCloud(familyId int64, personFileIdList []string) (bool, *apierror.ApiError)
- func (p *PanClient) AppUploadFileCommit(uploadCommitUrl, uploadFileId, xRequestId string) (*AppUploadFileCommitResult, *apierror.ApiError)
- func (p *PanClient) AppUploadFileCommitOverwrite(uploadCommitUrl, uploadFileId, xRequestId string, overwrite bool) (*AppUploadFileCommitResult, *apierror.ApiError)
- func (p *PanClient) AppUploadFileData(uploadUrl, uploadFileId, xRequestId string, fileRange *AppFileUploadRange, ...) *apierror.ApiError
- func (p *PanClient) AppUserSign() (*AppUserSignResult, *apierror.ApiError)
- func (p *PanClient) CheckBatchTask(typeFlag BatchTaskType, taskId string) (result *CheckTaskResult, error *apierror.ApiError)
- func (p *PanClient) CreateBatchTask(param *BatchTaskParam) (taskId string, error *apierror.ApiError)
- func (p *PanClient) FileInfoById(fileId string) (fileInfo *FileEntity, error *apierror.ApiError)
- func (p *PanClient) FileInfoByPath(pathStr string) (fileInfo *FileEntity, error *apierror.ApiError)
- func (p *PanClient) FileList(param *FileListParam) (result *FileSearchResult, error *apierror.ApiError)
- func (p *PanClient) FileSearch(param *FileSearchParam) (result *FileSearchResult, error *apierror.ApiError)
- func (p *PanClient) FilesDirectoriesRecurseList(path string, handleFileDirectoryFunc HandleFileDirectoryFunc) FileList
- func (p *PanClient) GetUserDetailInfo() (userDetailInfo *UserDetailInfo, error *apierror.ApiError)
- func (p *PanClient) GetUserInfo() (userInfo *UserInfo, error *apierror.ApiError)
- func (p *PanClient) Heartbeat() bool
- func (p *PanClient) Mkdir(parentFileId, dirName string) (*MkdirResult, *apierror.ApiError)
- func (p *PanClient) MkdirRecursive(parentFileId string, fullPath string, index int, pathSlice []string) (*MkdirResult, *apierror.ApiError)
- func (p *PanClient) RecycleClear(familyId int64) *apierror.ApiError
- func (p *PanClient) RecycleDelete(familyId int64, fileIdList []string) *apierror.ApiError
- func (p *PanClient) RecycleList(pageNum, pageSize int) (result *RecycleFileListResult, error *apierror.ApiError)
- func (p *PanClient) RecycleRestore(fileList []*RecycleFileInfo) (taskId string, err *apierror.ApiError)
- func (p *PanClient) Rename(renameFileId, newName string) (bool, *apierror.ApiError)
- func (p *PanClient) ShareCancel(shareIdList []int64) (bool, *apierror.ApiError)
- func (p *PanClient) ShareList(param *ShareListParam) (*ShareListResult, *apierror.ApiError)
- func (p *PanClient) SharePrivate(fileId string, expiredTime ShareExpiredTime) (*PrivateShareResult, *apierror.ApiError)
- func (p *PanClient) SharePublic(fileId string, expiredTime ShareExpiredTime) (*PublicShareResult, *apierror.ApiError)
- func (p *PanClient) ShareSave(accessUrl string, accessCode string, savePanDirId string) (bool, *apierror.ApiError)
- func (p *PanClient) UserDrawPrize(taskId ActivityTaskId) (*UserDrawPrizeResult, *apierror.ApiError)
- type PathEntity
- type PathList
- type PrivateShareResult
- type PublicShareResult
- type RecycleFileActResult
- type RecycleFileInfo
- type RecycleFileInfoList
- type RecycleFileListResult
- type ShareExpiredTime
- type ShareItem
- type ShareItemList
- type ShareListParam
- type ShareListResult
- type ShareMode
- type UploadFunc
- type UserDetailInfo
- type UserDrawPrizeResult
- type UserInfo
- type UserVip
- type WebLoginToken
Constants ¶
const ( WEB_URL string = "https://cloud.189.cn" AUTH_URL string = "https://open.e.189.cn/api/logbox/oauth2" API_URL string = "https://api.cloud.189.cn" )
const ( // BatchTaskStatusNotAction 无需任何操作 BatchTaskStatusNotAction BatchTaskStatus = 2 // BatchTaskStatusOk 成功 BatchTaskStatusOk BatchTaskStatus = 4 // BatchTaskTypeDelete 删除文件任务 BatchTaskTypeDelete BatchTaskType = "DELETE" // BatchTaskTypeCopy 复制文件任务 BatchTaskTypeCopy BatchTaskType = "COPY" // BatchTaskTypeMove 移动文件任务 BatchTaskTypeMove BatchTaskType = "MOVE" // BatchTaskTypeRecycleRestore 还原回收站文件 BatchTaskTypeRecycleRestore BatchTaskType = "RESTORE" BatchTaskTypeShareSave BatchTaskType = "SHARE_SAVE" )
const ( // MediaTypeDefault 默认全部 MediaTypeDefault MediaType = 0 // MediaTypeMusic 音乐 MediaTypeMusic MediaType = 1 // MediaTypeVideo 视频 MediaTypeVideo MediaType = 3 // MediaTypeDocument 文档 MediaTypeDocument MediaType = 4 // OrderByName 文件名 OrderByName OrderBy = 1 // OrderBySize 大小 OrderBySize OrderBy = 2 // OrderByTime 时间 OrderByTime OrderBy = 3 // OrderAsc 升序 OrderAsc OrderSort = "ASC" // OrderDesc 降序 OrderDesc OrderSort = "DESC" )
const ( ShareExpiredTime = 1 ShareExpiredTime7Day ShareExpiredTime = 7 ShareExpiredTimeForever ShareExpiredTime = 2099 ShareModePrivate ShareMode = 1 ShareModePublic ShareMode = 2 )ShareExpiredTime1Day
const (
// PathSeparator 路径分隔符
PathSeparator = "/"
)
Variables ¶
This section is empty.
Functions ¶
func GetCaptchaImage ¶
func RefreshCookieToken ¶
Types ¶
type AccessCount ¶
type ActivityTaskId ¶
type ActivityTaskId string
const ( ActivitySignin ActivityTaskId = "TASK_SIGNIN" ActivitySignPhotos ActivityTaskId = "TASK_SIGNIN_PHOTOS" )
type AppCheckBatchTaskResult ¶
type AppCopyFileParam ¶
type AppCreateBatchTaskResult ¶
type AppCreateBatchTaskResult struct {
TaskId string `xml:"taskId"`
}
type AppCreateUploadFileResult ¶
type AppCreateUploadFileResult struct { XMLName xml.Name `xml:"uploadFile"` // UploadFileId 上传文件请求ID UploadFileId string `xml:"uploadFileId"` // FileUploadUrl 上传文件数据的URL路径 FileUploadUrl string `xml:"fileUploadUrl"` // FileCommitUrl 上传文件完成后确认路径 FileCommitUrl string `xml:"fileCommitUrl"` // FileDataExists 文件是否已存在云盘中,0-未存在,1-已存在 FileDataExists int `xml:"fileDataExists"` // 请求的X-Request-ID XRequestId string }
type AppFamilyInfo ¶
type AppFamilyInfo struct { Count int `xml:"count" xml:"count"` Type int `xml:"type" json:"type"` UserRole int `xml:"userRole" json:"userRole"` CreateTime string `xml:"createTime" json:"createTime"` FamilyId int64 `xml:"familyId" json:"familyId"` RemarkName string `xml:"remarkName" json:"remarkName"` UseFlag int `xml:"useFlag" json:"useFlag"` }
AppGetFileInfoParam 获取文件信息参数
type AppFamilyInfoListResult ¶
type AppFamilyInfoListResult struct { XMLName xml.Name `xml:"familyListResponse"` FamilyInfoList []*AppFamilyInfo `xml:"familyInfo" json:"familyInfoList"` }
type AppFileDownloadRange ¶
type AppFileEntity ¶
type AppFileEntity struct { // FileId 文件ID FileId string `xml:"id"` // ParentId 父文件夹ID ParentId string `xml:"parentId"` // FileMd5 文件MD5,文件夹为空,空文件默认为 D41D8CD98F00B204E9800998ECF8427E FileMd5 string `xml:"md5"` // FileName 名称 FileName string `xml:"name"` // FileSize 文件大小 FileSize int64 `xml:"size"` // LastOpTime 最后修改时间 LastOpTime string `xml:"lastOpTime"` // CreateTime 创建时间 CreateTime string `xml:"createDate"` // 文件完整路径 Path string `xml:"path"` // MediaType 媒体类型 MediaType MediaType `xml:"mediaType"` // IsFolder 是否是文件夹 IsFolder bool // FileCount 文件夹子文件数量,对文件夹详情有效 SubFileCount uint `xml:"fileCount"` StartLabel int `xml:"startLabel"` FavoriteLabel int `xml:"favoriteLabel"` Orientation int `xml:"orientation"` Rev string `xml:"rev"` FileCata int `xml:"fileCata"` }
AppFileEntity 文件/文件夹信息
func NewAppFileEntityForRootDir ¶
func NewAppFileEntityForRootDir() *AppFileEntity
func (*AppFileEntity) CreateFileEntity ¶
func (f *AppFileEntity) CreateFileEntity() *FileEntity
func (*AppFileEntity) String ¶
func (f *AppFileEntity) String() string
type AppFileList ¶
type AppFileList []*AppFileEntity
func (AppFileList) Count ¶
func (afl AppFileList) Count() (fileN, directoryN int64)
Count 获取文件总数和目录总数
type AppFileListParam ¶
type AppFileListParam struct { // 家庭云ID FamilyId int64 // FileId 文件ID FileId string // OrderBy 排序字段 OrderBy OrderBy // OrderSort 排序顺序 OrderSort OrderSort // PageNum 页数量,从1开始 PageNum uint // PageSize 页大小,默认60 PageSize uint // 默认是不返回Path路径,是否构建 ConstructPath bool }
FileListParam 文件列表参数
func NewAppFileListParam ¶
func NewAppFileListParam() *AppFileListParam
type AppFileListResult ¶
type AppFileListResult struct { LastRev string // 总数量 Count int // 文件列表 FileList AppFileList }
AppFileListResult 文件列表响应值
type AppFileUploadRange ¶
type AppGetFileInfoParam ¶
type AppGetFileInfoParam struct { // 家庭云ID FamilyId int64 // FileId 文件ID,支持文件和文件夹 FileId string // FilePath 文件绝对路径,支持文件和文件夹 FilePath string }
AppGetFileInfoParam 获取文件信息参数
type AppGetFileInfoResult ¶
type AppGetFileInfoResult struct { //XMLName xml.Name `xml:"folderInfo"` FileId string `xml:"id"` ParentId string `xml:"parentFolderId"` FileName string `xml:"name"` CreateDate string `xml:"createDate"` LastOpTime string `xml:"lastOpTime"` Path string `xml:"path"` Rev string `xml:"rev"` ParentFolderList parentFolderListNode `xml:"parentFolderList"` GroupSpaceId string `xml:"groupSpaceId"` }
AppGetFileInfoResult 文件信息响应值
type AppLoginToken ¶
type AppLoginToken struct { SessionKey string `json:"sessionKey"` SessionSecret string `json:"sessionSecret"` FamilySessionKey string `json:"familySessionKey"` FamilySessionSecret string `json:"familySessionSecret"` AccessToken string `json:"accessToken"` RefreshToken string `json:"refreshToken"` // 有效期的token SskAccessToken string `json:"sskAccessToken"` // token 过期时间点,时间戳ms SskAccessTokenExpiresIn int64 `json:"sskAccessTokenExpiresIn"` RsaPublicKey string `json:"rsaPublicKey"` }
type AppMkdirResult ¶
type AppMkdirResult struct { //XMLName xml.Name `xml:"folder"` // fileId 文件ID FileId string `xml:"id"` // ParentId 父文件夹ID ParentId string `xml:"parentId"` // FileName 名称 FileName string `xml:"name"` // LastOpTime 最后修改时间 LastOpTime string `xml:"lastOpTime"` // CreateTime 创建时间 CreateTime string `xml:"createDate"` Rev string `xml:"rev"` FileCata int `xml:"fileCata"` }
type AppMoveFileResult ¶
type AppMoveFileResult struct { XMLName xml.Name `xml:"fileList"` // 总数量 Count int `xml:"count"` // 文件夹列表 FolderList AppFileList `xml:"folder"` // 文件列表 FileList AppFileList `xml:"file"` }
type AppOrderBy ¶
type AppOrderBy string
const ( // AppOrderByName 文件名 AppOrderByName AppOrderBy = "filename" // AppOrderBySize 大小 AppOrderBySize AppOrderBy = "filesize" // AppOrderByTime 时间 AppOrderByTime AppOrderBy = "lastOpTime" // 空文件夹默认MD5 DefaultEmptyFileMd5 = "D41D8CD98F00B204E9800998ECF8427E" )
type AppUploadFileCommitResult ¶
type AppUploadFileCommitResult struct { XMLName xml.Name `xml:"file"` Id string `xml:"id"` Name string `xml:"name"` Size string `xml:"size"` Md5 string `xml:"md5"` CreateDate string `xml:"createDate"` Rev string `xml:"rev"` UserId string `xml:"userId"` RequestId string `xml:"requestId"` IsSafe string `xml:"isSafe"` }
type AppUserSignResult ¶
type AppUserSignResult struct { Status AppUserSignStatus Tip string }
type AppUserSignStatus ¶
type AppUserSignStatus int
const ( AppUserSignStatusFailed AppUserSignStatus = 0 AppUserSignStatusSuccess AppUserSignStatus = 1 AppUserSignStatusHasSign AppUserSignStatus = -1 )
type BatchTaskInfo ¶
type BatchTaskInfo struct { // FileId 文件ID FileId string `json:"fileId"` // FileName 文件名 FileName string `json:"fileName"` // IsFolder 是否是文件夹,0-否,1-是 IsFolder int `json:"isFolder"` // SrcParentId 文件所在父目录ID SrcParentId string `json:"srcParentId"` }
TaskInfo 任务信息
type BatchTaskInfoList ¶
type BatchTaskInfoList []*BatchTaskInfo
type BatchTaskParam ¶
type BatchTaskParam struct { TypeFlag BatchTaskType `json:"type"` TaskInfos BatchTaskInfoList `json:"taskInfos"` TargetFolderId string `json:"targetFolderId"` }
BatchTaskParam 任务参数
type BatchTaskStatus ¶
type BatchTaskStatus int
type BatchTaskType ¶
type BatchTaskType string
type CheckTaskResult ¶
type CheckTaskResult struct { FailedCount int `json:"failedCount" xml:"failedCount"` SkipCount int `json:"skipCount" xml:"skipCount"` SubTaskCount int `json:"subTaskCount" xml:"subTaskCount"` SuccessedCount int `json:"successedCount" xml:"successedCount"` SuccessedFileIdList []int64 `json:"successedFileIdList" xml:"successedFileIdList"` TaskId string `json:"taskId" xml:"taskId"` // TaskStatus 任务状态, 4-成功 TaskStatus BatchTaskStatus `json:"taskStatus" xml:"taskStatus"` }
CheckTaskResult 检查任务结果
type DownloadFuncCallback ¶
type FileEntity ¶
type FileEntity struct { // FileId 文件ID FileId string `json:"fileId"` // ParentId 父文件ID ParentId string `json:"parentId"` // FileIdDigest 文件ID指纹 FileIdDigest string `json:"fileIdDigest"` // FileName 文件名 FileName string `json:"fileName"` // FileSize 文件大小,文件夹为0 FileSize int64 `json:"fileSize"` // LastOpTime 最后修改时间 LastOpTime string `json:"lastOpTime"` // CreateTime 创建时间 CreateTime string `json:"createTime"` // FilePath 文件的完整路径 Path string `json:"path"` // MediaType 媒体类型 MediaType MediaType `json:"mediaType"` // IsFolder 是否是文件夹 IsFolder bool `json:"isFolder"` // SubFileCount 文件夹子文件数量,对文件夹详情有效 SubFileCount uint `json:"subFileCount"` // FileType 文件类型,后缀名,例如:"dmg",没有则为空 FileType string `json:"fileType"` // DownloadUrl 下载路径,只有文件才有 DownloadUrl string `json:"downloadUrl"` // IsStarred 是否是星标文件 IsStarred bool `json:"isStarred"` }
FileEntity 文件/文件夹信息
func NewFileEntityForRootDir ¶
func NewFileEntityForRootDir() *FileEntity
NewFileEntityForRootDir 创建根目录"/"的默认文件信息
func (*FileEntity) CreateFileEntity ¶
func (f *FileEntity) CreateFileEntity() *AppFileEntity
func (*FileEntity) String ¶
func (f *FileEntity) String() string
type FileList ¶
type FileList []*FileEntity
type FileListParam ¶
type FileListParam struct { // FileId 文件ID FileId string // MediaType 媒体文件过滤 MediaType MediaType // InGroupSpace ??? InGroupSpace bool // OrderBy 排序字段 OrderBy OrderBy // OrderSort 排序顺序 OrderSort OrderSort // PageNum 页数量,从1开始 PageNum uint // PageSize 页大小,默认60 PageSize uint }
FileListParam 文件列表参数
func NewFileListParam ¶
func NewFileListParam() *FileListParam
type FileSearchParam ¶
type FileSearchParam struct { FileListParam // FileId 文件ID // Keyword 搜索关键字 Keyword string }
FileSearchParam 文件搜索参数
type FileSearchResult ¶
type FileSearchResult struct { // Data 数据 Data FileList `json:"data"` // PageNum 页数量,从1开始 PageNum uint `json:"pageNum"` // PageSize 页大小,默认60 PageSize uint `json:"pageSize"` // Path 路径 Path PathList `json:"path"` // RecordCount 文件总数量 RecordCount uint `json:"recordCount"` }
FileSearchResult 文件搜索返回结果
type HandleAppFileDirectoryFunc ¶
type HandleAppFileDirectoryFunc func(depth int, fdPath string, fd *AppFileEntity, apierr *apierror.ApiError) bool
HandleFileDirectoryFunc 处理文件或目录的元信息, 返回值控制是否退出递归
type HandleFileDirectoryFunc ¶
type HandleFileDirectoryFunc func(depth int, fdPath string, fd *FileEntity, apierr *apierror.ApiError) bool
HandleFileDirectoryFunc 处理文件或目录的元信息, 返回值控制是否退出递归
type MkdirResult ¶
type PanClient ¶
type PanClient struct {
// contains filtered or unexported fields
}
func NewPanClient ¶
func NewPanClient(webToken WebLoginToken, appToken AppLoginToken) *PanClient
func (*PanClient) AppCheckBatchTask ¶
func (p *PanClient) AppCheckBatchTask(typeFlag BatchTaskType, taskId string) (result *CheckTaskResult, error *apierror.ApiError)
AppCheckBatchTask 检测批量任务状态和结果
func (*PanClient) AppCopyFile ¶
func (p *PanClient) AppCopyFile(param *AppCopyFileParam) (*AppFileEntity, *apierror.ApiError)
AppCopyFile 复制文件到目标文件夹
func (*PanClient) AppCreateBatchTask ¶
func (p *PanClient) AppCreateBatchTask(familyId int64, param *BatchTaskParam) (taskId string, error *apierror.ApiError)
AppCreateBatchTask 创建批量处理任务
func (*PanClient) AppCreateUploadFile ¶
func (p *PanClient) AppCreateUploadFile(param *AppCreateUploadFileParam) (*AppCreateUploadFileResult, *apierror.ApiError)
func (*PanClient) AppDeleteFile ¶
AppDeleteFile 删除文件/文件夹
func (*PanClient) AppDownloadFileData ¶
func (p *PanClient) AppDownloadFileData(downloadFileUrl string, fileRange AppFileDownloadRange, downloadFunc DownloadFuncCallback) *apierror.ApiError
func (*PanClient) AppFamilyCreateUploadFile ¶
func (p *PanClient) AppFamilyCreateUploadFile(param *AppCreateUploadFileParam) (*AppCreateUploadFileResult, *apierror.ApiError)
func (*PanClient) AppFamilyDownloadFileData ¶
func (p *PanClient) AppFamilyDownloadFileData(downloadFileUrl string, fileRange AppFileDownloadRange, downloadFunc DownloadFuncCallback) *apierror.ApiError
func (*PanClient) AppFamilyGetFamilyList ¶
func (p *PanClient) AppFamilyGetFamilyList() (*AppFamilyInfoListResult, *apierror.ApiError)
AppGetFamilyList 获取用户的家庭列表
func (*PanClient) AppFamilyGetFileDownloadUrl ¶
func (*PanClient) AppFamilyGetUploadFileStatus ¶
func (p *PanClient) AppFamilyGetUploadFileStatus(familyId int64, uploadFileId string) (*AppGetUploadFileStatusResult, *apierror.ApiError)
AppFamilyGetUploadFileStatus 查询上传的文件状态
func (*PanClient) AppFamilyMoveFile ¶
func (p *PanClient) AppFamilyMoveFile(familyId int64, fileId string, destParentId string) (*AppFileEntity, *apierror.ApiError)
AppFamilyMoveFile 移动文件/文件夹
func (*PanClient) AppFamilyRenameFile ¶
func (*PanClient) AppFamilySaveFileToPersonCloud ¶
func (p *PanClient) AppFamilySaveFileToPersonCloud(familyId int64, familyFileIdList []string) (bool, *apierror.ApiError)
AppFamilySaveFileToPersonCloud 复制家庭共享文件文件到个人云
func (*PanClient) AppFamilyUploadFileCommit ¶
func (*PanClient) AppFamilyUploadFileData ¶
func (p *PanClient) AppFamilyUploadFileData(familyId int64, uploadUrl, uploadFileId, xRequestId string, fileRange *AppFileUploadRange, uploadFunc UploadFunc) *apierror.ApiError
func (*PanClient) AppFileInfoById ¶
func (p *PanClient) AppFileInfoById(familyId int64, fileId string) (fileInfo *AppFileEntity, error *apierror.ApiError)
AppFileInfoById 通过FileId获取文件详情
func (*PanClient) AppFileInfoByPath ¶
func (p *PanClient) AppFileInfoByPath(familyId int64, pathStr string) (fileInfo *AppFileEntity, error *apierror.ApiError)
AppFileInfoByPath 通过路径获取文件详情,pathStr是绝对路径
func (*PanClient) AppFileList ¶
func (p *PanClient) AppFileList(param *AppFileListParam) (*AppFileListResult, *apierror.ApiError)
AppFileList 获取文件列表
func (*PanClient) AppFilePathById ¶
AppGetFilePathById 通过FileId获取文件的绝对路径
func (*PanClient) AppFilesDirectoriesRecurseList ¶
func (p *PanClient) AppFilesDirectoriesRecurseList(familyId int64, path string, handleAppFileDirectoryFunc HandleAppFileDirectoryFunc) AppFileList
FilesDirectoriesRecurseList 递归获取目录下的文件和目录列表
func (*PanClient) AppGetAllFileList ¶
func (p *PanClient) AppGetAllFileList(param *AppFileListParam) (*AppFileListResult, *apierror.ApiError)
AppGetAllFileList 获取指定目录下的所有文件列表
func (*PanClient) AppGetBasicFileInfo ¶
func (p *PanClient) AppGetBasicFileInfo(param *AppGetFileInfoParam) (*AppGetFileInfoResult, *apierror.ApiError)
AppGetBasicFileInfo 根据文件ID或者文件绝对路径获取文件信息,支持文件和文件夹
func (*PanClient) AppGetFileDownloadUrl ¶
func (*PanClient) AppGetUploadFileStatus ¶
func (p *PanClient) AppGetUploadFileStatus(uploadFileId string) (*AppGetUploadFileStatusResult, *apierror.ApiError)
AppGetUploadFileStatus 查询上传的文件状态
func (*PanClient) AppMkdir ¶
func (p *PanClient) AppMkdir(familyId int64, parentFileId, dirName string) (*AppMkdirResult, *apierror.ApiError)
AppMkdir 创建文件夹
func (*PanClient) AppMkdirRecursive ¶
func (*PanClient) AppMoveFile ¶
func (p *PanClient) AppMoveFile(fileIdList []string, targetFolderId string) (*AppMoveFileResult, *apierror.ApiError)
AppMoveFile 移动文件/文件夹
func (*PanClient) AppRenameFile ¶
func (p *PanClient) AppRenameFile(renameFileId, newName string) (*AppFileEntity, *apierror.ApiError)
AppRenameFile 重命名文件/文件夹
func (*PanClient) AppSaveFileToFamilyCloud ¶
func (p *PanClient) AppSaveFileToFamilyCloud(familyId int64, personFileIdList []string) (bool, *apierror.ApiError)
AppSaveFileToFamilyCloud 复制个人云文件文件到家庭云
func (*PanClient) AppUploadFileCommit ¶
func (p *PanClient) AppUploadFileCommit(uploadCommitUrl, uploadFileId, xRequestId string) (*AppUploadFileCommitResult, *apierror.ApiError)
AppUploadFileCommit 上传文件完成提交接口
func (*PanClient) AppUploadFileCommitOverwrite ¶
func (p *PanClient) AppUploadFileCommitOverwrite(uploadCommitUrl, uploadFileId, xRequestId string, overwrite bool) (*AppUploadFileCommitResult, *apierror.ApiError)
AppUploadFileCommitOverwrite 上传文件完成提交接口 如果 overwrite=true,则会覆盖同名文件,否则如遇到同名文件新上传的文件会自动重命名
func (*PanClient) AppUploadFileData ¶
func (p *PanClient) AppUploadFileData(uploadUrl, uploadFileId, xRequestId string, fileRange *AppFileUploadRange, uploadFunc UploadFunc) *apierror.ApiError
func (*PanClient) AppUserSign ¶
func (p *PanClient) AppUserSign() (*AppUserSignResult, *apierror.ApiError)
AppUserSign 用户签到
func (*PanClient) CheckBatchTask ¶
func (p *PanClient) CheckBatchTask(typeFlag BatchTaskType, taskId string) (result *CheckTaskResult, error *apierror.ApiError)
func (*PanClient) CreateBatchTask ¶
func (p *PanClient) CreateBatchTask(param *BatchTaskParam) (taskId string, error *apierror.ApiError)
func (*PanClient) FileInfoById ¶
func (p *PanClient) FileInfoById(fileId string) (fileInfo *FileEntity, error *apierror.ApiError)
func (*PanClient) FileInfoByPath ¶
func (p *PanClient) FileInfoByPath(pathStr string) (fileInfo *FileEntity, error *apierror.ApiError)
FileInfoByPath 通过路径获取文件详情,pathStr是绝对路径
func (*PanClient) FileList ¶
func (p *PanClient) FileList(param *FileListParam) (result *FileSearchResult, error *apierror.ApiError)
func (*PanClient) FileSearch ¶
func (p *PanClient) FileSearch(param *FileSearchParam) (result *FileSearchResult, error *apierror.ApiError)
func (*PanClient) FilesDirectoriesRecurseList ¶
func (p *PanClient) FilesDirectoriesRecurseList(path string, handleFileDirectoryFunc HandleFileDirectoryFunc) FileList
FilesDirectoriesRecurseList 递归获取目录下的文件和目录列表
func (*PanClient) GetUserDetailInfo ¶
func (p *PanClient) GetUserDetailInfo() (userDetailInfo *UserDetailInfo, error *apierror.ApiError)
func (*PanClient) GetUserInfo ¶
func (*PanClient) Mkdir ¶
func (p *PanClient) Mkdir(parentFileId, dirName string) (*MkdirResult, *apierror.ApiError)
func (*PanClient) MkdirRecursive ¶
func (*PanClient) RecycleClear ¶
func (*PanClient) RecycleDelete ¶
RecycleDelete 删除回收站文件或目录
func (*PanClient) RecycleList ¶
func (p *PanClient) RecycleList(pageNum, pageSize int) (result *RecycleFileListResult, error *apierror.ApiError)
RecycleList 列出回收站文件列表
func (*PanClient) RecycleRestore ¶
func (p *PanClient) RecycleRestore(fileList []*RecycleFileInfo) (taskId string, err *apierror.ApiError)
func (*PanClient) ShareCancel ¶
func (*PanClient) ShareList ¶
func (p *PanClient) ShareList(param *ShareListParam) (*ShareListResult, *apierror.ApiError)
func (*PanClient) SharePrivate ¶
func (p *PanClient) SharePrivate(fileId string, expiredTime ShareExpiredTime) (*PrivateShareResult, *apierror.ApiError)
func (*PanClient) SharePublic ¶
func (p *PanClient) SharePublic(fileId string, expiredTime ShareExpiredTime) (*PublicShareResult, *apierror.ApiError)
func (*PanClient) ShareSave ¶
func (p *PanClient) ShareSave(accessUrl string, accessCode string, savePanDirId string) (bool, *apierror.ApiError)
ShareSave 转存分享到对应的文件夹
func (*PanClient) UserDrawPrize ¶
func (p *PanClient) UserDrawPrize(taskId ActivityTaskId) (*UserDrawPrizeResult, *apierror.ApiError)
抽奖
type PathEntity ¶
type PathList ¶
type PathList []*PathEntity
type PrivateShareResult ¶
type PrivateShareResult struct {}
type PublicShareResult ¶
type PublicShareResult struct {}
type RecycleFileActResult ¶
type RecycleFileActResult struct {
Success bool `json:"success"`
}
type RecycleFileInfo ¶
type RecycleFileInfo struct { // CreateTime 创建时间 CreateTime string `json:"createTime"` // FileId 文件ID FileId string `json:"fileId"` // FileName 文件名 FileName string `json:"fileName"` // FileSize 文件大小,文件夹为0 FileSize int64 `json:"fileSize"` // FileType 文件类型,后缀名,例如:"dmg",没有则为空 FileType string `json:"fileType"` // IsFolder 是否是文件夹 IsFolder bool `json:"isFolder"` // IsFamilyFile 是否是家庭云文件 IsFamilyFile bool `json:"isFamilyFile"` // LastOpTime 最后修改时间 LastOpTime string `json:"lastOpTime"` // ParentId 父文件ID ParentId string `json:"parentId"` // DownloadUrl 下载路径,只有文件才有 DownloadUrl string `json:"downloadUrl"` // MediaType 媒体类型 MediaType MediaType `json:"mediaType"` // PathStr 文件的完整路径 PathStr string `json:"pathStr"` }
RecycleFileInfo 回收站中文件/目录信息
type RecycleFileInfoList ¶
type RecycleFileInfoList []*RecycleFileInfo
type RecycleFileListResult ¶
type RecycleFileListResult struct { // Data 数据 Data RecycleFileInfoList `json:"data"` // PageNum 页数量,从1开始 PageNum uint `json:"pageNum"` // PageSize 页大小,默认60 PageSize uint `json:"pageSize"` // RecordCount 文件总数量 RecordCount uint `json:"recordCount"` FamilyId int64 `json:"familyId"` FamilyName string `json:"familyName"` }
type ShareExpiredTime ¶
type ShareExpiredTime int
type ShareItem ¶
type ShareItem struct { string `json:"accessCode"` AccessURL string `json:"accessURL"` AccessCount AccessCount `json:"accessCount"` DownloadUrl string `json:"downloadUrl"` LongDownloadUrl string `json:"longDownloadUrl"` FileId string `json:"fileId"` FileIdDigest string `json:"fileIdDigest"` FileName string `json:"fileName"` FilePath string `json:"filePath"` FileSize int64 `json:"fileSize"` IconURL string `json:"iconURL"` IsFolder bool `json:"isFolder"` // MediaType 文件类别 NickName string `json:"nickName"` ReviewStatus int `json:"reviewStatus"` ShareDate int64 `json:"shareDate"` ShareId int64 `json:"shareId"` ShareMode ShareMode `json:"shareMode"` ShareTime int64 `json:"shareTime"` ShareType int `json:"shareType"` ShortShareUrl string `json:"shortShareUrl"` }AccessCode
type ShareItemList ¶
type ShareItemList []*ShareItem
type ShareListParam ¶
type ShareListParam struct {}
func NewShareListParam ¶
func NewShareListParam() *ShareListParam
type UploadFunc ¶
type UploadFunc func(httpMethod, fullUrl string, headers map[string]string) (resp *http.Response, err error)
UploadFunc 上传文件处理函数
type UserDetailInfo ¶
type UserDetailInfo struct { // 性别 F-女 M-男 Gender string `json:"gender"` // 省代码 ProvinceCode string `json:"provinceCode"` // 城市代码 CityCode string `json:"cityCode"` // 登录名 UserAccount string `json:"userAccount"` // 手机号,模糊处理过的,没有设定则为空 SafeMobile string `json:"safeMobile"` // 域名称 DomainName string `json:"domainName"` // 昵称 Nickname string `json:"nickname"` // 邮箱,没有设定则为空 Email string `json:"email"` }
type UserDrawPrizeResult ¶
type UserInfo ¶
type UserInfo struct { // 用户UID UserId uint64 `json:"userId"` // 用户登录名,一般为 xxx@189.cn UserAccount string `json:"userAccount"` // 昵称,如果没有设置则为空 Nickname string `json:"nickname"` // 域名称,默认和UserId一样 DomainName string `json:"domainName"` // 189邮箱已使用空间大小 Used189Size uint64 `json:"used189Size"` // 已使用个人空间大小 UsedSize uint64 `json:"usedSize"` // 个人空间总大小 Quota uint64 `json:"quota"` // 会员开始时间 SuperBeginTime string `json:"superBeginTime"` // 会员结束时间 SuperEndTime string `json:"superEndTime"` // 今天是否已签到 IsSign bool `json:"isSign"` // VIP会员标志位 SuperVip UserVip `json:"superVip"` }
type WebLoginToken ¶
type WebLoginToken struct {
CookieLoginUser string `json:"cookieLoginUser"`
}
func Login ¶
func Login(username, password string) (webToken *WebLoginToken, error *apierror.ApiError)
func LoginWithCaptcha ¶
func LoginWithCaptcha(username, password, captchaCode string) (webToken *WebLoginToken, error *apierror.ApiError)
Source Files ¶
- api_constant.go
- app_batch_task.go
- app_family.go
- app_family_file_download.go
- app_family_file_move.go
- app_family_file_rename.go
- app_family_file_upload.go
- app_file_copy.go
- app_file_delete.go
- app_file_directory.go
- app_file_download.go
- app_file_move.go
- app_file_rename.go
- app_file_save.go
- app_file_upload.go
- app_login.go
- app_mkdir.go
- app_user_sign.go
- batch_task.go
- file_directory.go
- heartbeat.go
- login.go
- mkdir.go
- pan_client.go
- recycle.go
- rename.go
- share.go
- user_draw_prize.go
- user_info.go