Documentation
¶
Index ¶
- Constants
- type CreateDirResponse
- type Downloader
- func NewDownloader(accessToken string, downloadLink string, localFilePath string) *Downloader
- func NewDownloaderWithConfiguration(accessToken string, downloadLink string, localFilePath string, ...) *Downloader
- func NewDownloaderWithFsID(accessToken string, fsID uint64, localFilePath string) *Downloader
- func NewDownloaderWithFsIDAndConf(accessToken string, fsID uint64, localFilePath string, ...) *Downloader
- func NewDownloaderWithPath(accessToken string, path string, localFilePath string) *Downloader
- type File
- type IManagerRequestDTO
- type ListResponse
- type ListResponseListItem
- type LocalFileInfo
- type Manager
- func (m *Manager) Copy(req *ManagerCopyRequestDTO) (*ManagerResponse, *httpclient.HttpResponse, error)
- func (m *Manager) Delete(req *ManagerDeleteRequestDTO) (*ManagerResponse, *httpclient.HttpResponse, error)
- func (m *Manager) Move(req *ManagerCopyRequestDTO) (*ManagerResponse, *httpclient.HttpResponse, error)
- func (m *Manager) Rename(req *ManagerRenameRequestDTO) (*ManagerResponse, *httpclient.HttpResponse, error)
- type ManagerCopyRequestDTO
- type ManagerCopyRequestFileItem
- type ManagerDeleteRequestDTO
- type ManagerRenameRequestDTO
- type ManagerRenameRequestFileItem
- type ManagerResponse
- type ManagerResponseInfoItem
- type MetasResponse
- type MetasResponseListItem
- type PreCreateResponse
- type SuperFile2UploadResponse
- type UploadResponse
- type Uploader
- func (u *Uploader) Create(uploadID string, blockList []string) (UploadResponse, error)
- func (u *Uploader) PreCreate() (PreCreateResponse, error)
- func (u *Uploader) SuperFile2Upload(uploadID string, partSeq int, partByte []byte) (SuperFile2UploadResponse, error)
- func (u *Uploader) Upload() (UploadResponse, error)
Constants ¶
View Source
const ( ListUri = "/rest/2.0/xpan/file?method=list" MetasUri = "/rest/2.0/xpan/multimedia?method=filemetas" StreamingUri = "/rest/2.0/xpan/file?method=streaming" ManagerUri = "/rest/2.0/xpan/file?method=filemanager" )
View Source
const ( PreCreateUri = "/rest/2.0/xpan/file?method=precreate" CreateUri = "/rest/2.0/xpan/file?method=create" Superfile2UploadUri = "/rest/2.0/pcs/superfile2?method=upload" )
View Source
const (
PcsFileDownloadUri = "/rest/2.0/pcs/file?method=download"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateDirResponse ¶
type Downloader ¶
type Downloader struct { LocalFilePath string DownloadLink string FsID uint64 Path string AccessToken string TotalPart int Conf conf.PanConfiguration }
func NewDownloader ¶
func NewDownloader(accessToken string, downloadLink string, localFilePath string) *Downloader
func NewDownloaderWithConfiguration ¶
func NewDownloaderWithConfiguration(accessToken string, downloadLink string, localFilePath string, conf conf.PanConfiguration) *Downloader
func NewDownloaderWithFsID ¶
func NewDownloaderWithFsID(accessToken string, fsID uint64, localFilePath string) *Downloader
func NewDownloaderWithFsIDAndConf ¶
func NewDownloaderWithFsIDAndConf(accessToken string, fsID uint64, localFilePath string, conf conf.PanConfiguration) *Downloader
func NewDownloaderWithPath ¶
func NewDownloaderWithPath(accessToken string, path string, localFilePath string) *Downloader
非开放平台公开接口,生产环境谨慎使用
type File ¶
type File struct { AccessToken string Conf conf.PanConfiguration }
func NewFileClient ¶
func NewFileClientWithConfiguration ¶
func NewFileClientWithConfiguration(accessToken string, configuration conf.PanConfiguration) *File
type IManagerRequestDTO ¶
type ListResponse ¶
type ListResponse struct { conf.CloudDiskResponseBase List []ListResponseListItem }
type ListResponseListItem ¶
type ListResponseListItem struct { FsID uint64 `json:"fs_id"` Path string `json:"path"` ServerFileName string `json:"server_filename"` Size int64 `json:"size"` IsDir int `json:"isdir"` Category int `json:"category"` Md5 string `json:"md5"` DirEmpty string `json:"dir_empty"` Thumbs map[string]string `json:"thumbs"` LocalCtime int `json:"local_ctime"` LocalMtime int `json:"local_mtime"` ServerCtime int `json:"server_ctime"` ServerMtime int `json:"server_mtime"` }
type LocalFileInfo ¶
type Manager ¶
type Manager struct { AccessToken string Conf conf.PanConfiguration }
func NewManagerClientWithConfiguration ¶
func NewManagerClientWithConfiguration(accessToken string, configuration conf.PanConfiguration) *Manager
func (*Manager) Copy ¶
func (m *Manager) Copy(req *ManagerCopyRequestDTO) (*ManagerResponse, *httpclient.HttpResponse, error)
func (*Manager) Delete ¶
func (m *Manager) Delete(req *ManagerDeleteRequestDTO) (*ManagerResponse, *httpclient.HttpResponse, error)
func (*Manager) Move ¶
func (m *Manager) Move(req *ManagerCopyRequestDTO) (*ManagerResponse, *httpclient.HttpResponse, error)
func (*Manager) Rename ¶
func (m *Manager) Rename(req *ManagerRenameRequestDTO) (*ManagerResponse, *httpclient.HttpResponse, error)
type ManagerCopyRequestDTO ¶
type ManagerCopyRequestDTO struct { Async int Files []ManagerCopyRequestFileItem Ondup string }
func (*ManagerCopyRequestDTO) GetAsync ¶
func (d *ManagerCopyRequestDTO) GetAsync() int
func (*ManagerCopyRequestDTO) GetFileListJsonStr ¶
func (d *ManagerCopyRequestDTO) GetFileListJsonStr() string
func (*ManagerCopyRequestDTO) GetFiles ¶
func (d *ManagerCopyRequestDTO) GetFiles() any
func (*ManagerCopyRequestDTO) GetOndup ¶
func (d *ManagerCopyRequestDTO) GetOndup() string
type ManagerDeleteRequestDTO ¶
func (*ManagerDeleteRequestDTO) GetAsync ¶
func (d *ManagerDeleteRequestDTO) GetAsync() int
func (*ManagerDeleteRequestDTO) GetFileListJsonStr ¶
func (d *ManagerDeleteRequestDTO) GetFileListJsonStr() string
func (*ManagerDeleteRequestDTO) GetFiles ¶
func (d *ManagerDeleteRequestDTO) GetFiles() any
func (*ManagerDeleteRequestDTO) GetOndup ¶
func (d *ManagerDeleteRequestDTO) GetOndup() string
type ManagerRenameRequestDTO ¶
type ManagerRenameRequestDTO struct { Async int Files []ManagerRenameRequestFileItem Ondup string }
func (*ManagerRenameRequestDTO) GetAsync ¶
func (d *ManagerRenameRequestDTO) GetAsync() int
func (*ManagerRenameRequestDTO) GetFileListJsonStr ¶
func (d *ManagerRenameRequestDTO) GetFileListJsonStr() string
func (*ManagerRenameRequestDTO) GetFiles ¶
func (d *ManagerRenameRequestDTO) GetFiles() any
func (*ManagerRenameRequestDTO) GetOndup ¶
func (d *ManagerRenameRequestDTO) GetOndup() string
type ManagerResponse ¶
type ManagerResponse struct { conf.CloudDiskResponseBase Info []ManagerResponseInfoItem `json:"info,omitempty"` TaskID int64 `json:"taskid,omitempty"` }
type ManagerResponseInfoItem ¶
type MetasResponse ¶
type MetasResponse struct { ErrorCode int `json:"errno"` ErrorMsg string `json:"errmsg"` RequestID int RequestIDStr string `json:"request_id"` List []MetasResponseListItem }
type MetasResponseListItem ¶
type MetasResponseListItem struct { FsID uint64 `json:"fs_id"` Path string `json:"path"` Category int `json:"category"` FileName string `json:"filename"` IsDir int `json:"isdir"` Size int64 `json:"size"` Md5 string `json:"md5"` DLink string `json:"dlink"` Thumbs map[string]string `json:"thumbs"` ServerCtime int `json:"server_ctime"` ServerMtime int `json:"server_mtime"` DateTaken int `json:"date_taken"` Width int `json:"width"` Height int `json:"height"` }
type PreCreateResponse ¶
type PreCreateResponse struct { conf.CloudDiskResponseBase UploadID string `json:"uploadid"` Path string `json:"path"` ReturnType int `json:"return_type"` BlockList []int `json:"block_list"` Info UploadResponse `json:"info"` }
type SuperFile2UploadResponse ¶
type SuperFile2UploadResponse struct { conf.PcsResponseBase Md5 string `json:"md5"` UploadID string `json:"uploadid"` PartSeq string `json:"partseq"` //pcsapi PHP版本返回的是int类型,Go版本返回的是string类型 }
type UploadResponse ¶
type Uploader ¶
type Uploader struct { AccessToken string Path string //remote path LocalFilePath string Conf conf.PanConfiguration }
func NewUploader ¶
func NewUploaderWithConfiguration ¶
func NewUploaderWithConfiguration(accessToken, path, localFilePath string, conf conf.PanConfiguration) *Uploader
func (*Uploader) Create ¶
func (u *Uploader) Create(uploadID string, blockList []string) (UploadResponse, error)
file create
func (*Uploader) SuperFile2Upload ¶
func (u *Uploader) SuperFile2Upload(uploadID string, partSeq int, partByte []byte) (SuperFile2UploadResponse, error)
superfile2 upload
func (*Uploader) Upload ¶
func (u *Uploader) Upload() (UploadResponse, error)
上传文件到网盘,包括预创建、分片上传、创建3个步骤
Click to show internal directories.
Click to hide internal directories.