Documentation ¶
Index ¶
- Constants
- Variables
- type CpMvJSON
- type CpMvJSONList
- type ErrInfo
- type FileDirectory
- type FileDirectoryList
- type PCSApi
- func (p *PCSApi) Copy(cpmvJSON ...*CpMvJSON) (err error)
- func (p *PCSApi) FileDownload(path string, ...) (err error)
- func (p *PCSApi) FilesDirectoriesBatchMeta(paths ...string) (data FileDirectoryList, err error)
- func (p *PCSApi) FilesDirectoriesList(path string, recurse bool) (data FileDirectoryList, err error)
- func (p *PCSApi) FilesDirectoriesMeta(path string) (data *FileDirectory, err error)
- func (p *PCSApi) Isdir(pcspath string) bool
- func (p *PCSApi) Mkdir(path string) (err error)
- func (p *PCSApi) Move(cpmvJSON ...*CpMvJSON) (err error)
- func (p *PCSApi) QuotaInfo() (quota, used int64, err error)
- func (p *PCSApi) RapidUpload(targetPath, contentMD5, sliceMD5, crc32 string, length int64) (err error)
- func (p *PCSApi) Remove(paths ...string) (err error)
- func (p *PCSApi) Rename(from, to string) (err error)
- func (p *PCSApi) Upload(targetPath string, uploadFunc func(uploadURL string, jar *cookiejar.Jar) error) (err error)
- func (p *PCSApi) UploadCreateSuperFile(targetPath string, blockList ...string) (err error)
- func (p *PCSApi) UploadTmpFile(targetPath string, uploadFunc func(uploadURL string, jar *cookiejar.Jar) error) (err error)
Constants ¶
View Source
const (
// StrRemoteError 远端服务器返回错误
StrRemoteError = "远端服务器返回错误"
)
Variables ¶
View Source
var AppID int
AppID 百度 PCS 应用 ID
Functions ¶
This section is empty.
Types ¶
type CpMvJSONList ¶
type CpMvJSONList struct {
List []*CpMvJSON `json:"list"`
}
CpMvJSONList []*CpMvJSON 对象数组
func (CpMvJSONList) String ¶
func (cl CpMvJSONList) String() string
type ErrInfo ¶
type ErrInfo struct { Operation string `json:"-"` // 正在进行的操作 ErrCode int `json:"error_code"` // 错误代码 ErrMsg string `json:"error_msg"` // 错误消息 }
ErrInfo 远端服务器返回的错误信息
func NewErrorInfo ¶
NewErrorInfo 提供operation操作名称, 返回 *ErrInfo
type FileDirectory ¶
type FileDirectory struct { FsID int64 // fs_id Path string // 路径 Filename string // 文件名 或 目录名 Ctime int64 // 创建日期 Mtime int64 // 修改日期 MD5 string // md5 值 Size int64 // 文件大小 (目录为0) Isdir bool // 是否为目录 Ifhassubdir bool // 是否含有子目录 (只对目录有效) Parent *FileDirectory // 父目录信息 Children FileDirectoryList // 子目录信息 }
FileDirectory 文件或目录的详细信息
func (*FileDirectory) String ¶
func (f *FileDirectory) String() string
type FileDirectoryList ¶
type FileDirectoryList []*FileDirectory
FileDirectoryList FileDirectory 的 指针数组
func (FileDirectoryList) AllFilePaths ¶
func (fl FileDirectoryList) AllFilePaths() (pcspaths []string)
AllFilePaths 返回所有的网盘路径, 包括子目录
func (FileDirectoryList) Count ¶
func (fl FileDirectoryList) Count() (fileN, directoryN int64)
Count 获取文件总数和目录总数
func (FileDirectoryList) TotalSize ¶
func (fl FileDirectoryList) TotalSize() int64
TotalSize 获取目录下文件的总大小
type PCSApi ¶
type PCSApi struct {
// contains filtered or unexported fields
}
PCSApi 百度 PCS API 详情
func (*PCSApi) FileDownload ¶
func (p *PCSApi) FileDownload(path string, downloadFunc func(downloadURL string, jar *cookiejar.Jar, savePath string) error) (err error)
FileDownload 下载网盘内文件
func (*PCSApi) FilesDirectoriesBatchMeta ¶
func (p *PCSApi) FilesDirectoriesBatchMeta(paths ...string) (data FileDirectoryList, err error)
FilesDirectoriesBatchMeta 获取多个文件/目录的元信息
func (*PCSApi) FilesDirectoriesList ¶
func (p *PCSApi) FilesDirectoriesList(path string, recurse bool) (data FileDirectoryList, err error)
FilesDirectoriesList 获取目录下的文件和目录列表, 可选是否递归
func (*PCSApi) FilesDirectoriesMeta ¶
func (p *PCSApi) FilesDirectoriesMeta(path string) (data *FileDirectory, err error)
FilesDirectoriesMeta 获取单个文件/目录的元信息
func (*PCSApi) RapidUpload ¶
func (p *PCSApi) RapidUpload(targetPath, contentMD5, sliceMD5, crc32 string, length int64) (err error)
RapidUpload 秒传文件
func (*PCSApi) Upload ¶
func (p *PCSApi) Upload(targetPath string, uploadFunc func(uploadURL string, jar *cookiejar.Jar) error) (err error)
Upload 上传单个文件
func (*PCSApi) UploadCreateSuperFile ¶
UploadCreateSuperFile 分片上传—合并分片文件
Click to show internal directories.
Click to hide internal directories.