Documentation ¶
Index ¶
- Constants
- type Downloader
- type File
- type ListResponse
- type LocalFileInfo
- type ManagerResponse
- type MetasResponse
- 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" )
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 Downloader ¶ added in v0.0.3
type Downloader struct { LocalFilePath string DownloadLink string FsID uint64 Path string AccessToken string TotalPart int }
func NewDownloader ¶ added in v0.0.3
func NewDownloader(accessToken string, downloadLink string, localFilePath string) *Downloader
func NewDownloaderWithFsID ¶ added in v0.0.3
func NewDownloaderWithFsID(accessToken string, fsID uint64, localFilePath string) *Downloader
func NewDownloaderWithPath ¶ added in v1.0.1
func NewDownloaderWithPath(accessToken string, path string, localFilePath string) *Downloader
非开放平台公开接口,生产环境谨慎使用
type ListResponse ¶
type ListResponse struct { conf.CloudDiskResponseBase List []struct { FsID uint64 `json:"fs_id"` Path string `json:"path"` ServerFileName string `json:"server_filename"` Size int `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 ManagerResponse ¶ added in v0.0.3
type ManagerResponse struct { conf.CloudDiskResponseBase Info []struct { Path string TaskID int Errno int } }
type MetasResponse ¶
type MetasResponse struct { ErrorCode int `json:"errno"` ErrorMsg string `json:"errmsg"` RequestID int RequestIDStr string `json:"request_id"` List []struct { FsID uint64 `json:"fs_id"` Path string `json:"path"` Category int `json:"category"` FileName string `json:"filename"` IsDir int `json:"isdir"` Size int `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 ¶
func NewUploader ¶
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.