Documentation
¶
Index ¶
- Variables
- type AccessTokenResp
- type Addition
- type ApiInfo
- type BaseResp
- type DownloadInfoResp
- type File
- type FileListResp
- type Open123
- func (d *Open123) Config() driver.Config
- func (d *Open123) Copy(ctx context.Context, srcObj, dstDir model.Obj) error
- func (d *Open123) Drop(ctx context.Context) error
- func (d *Open123) GetAddition() driver.Additional
- func (d *Open123) Init(ctx context.Context) error
- func (d *Open123) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)
- func (d *Open123) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)
- func (d *Open123) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error
- func (d *Open123) Move(ctx context.Context, srcObj, dstDir model.Obj) error
- func (d *Open123) Put(ctx context.Context, dstDir model.Obj, file model.FileStreamer, ...) error
- func (d *Open123) Remove(ctx context.Context, obj model.Obj) error
- func (d *Open123) Rename(ctx context.Context, srcObj model.Obj, newName string) error
- func (d *Open123) Request(apiInfo *ApiInfo, method string, callback base.ReqCallback, resp interface{}) ([]byte, error)
- func (d *Open123) Upload(ctx context.Context, file model.FileStreamer, createResp *UploadCreateResp, ...) error
- type RefreshTokenResp
- type UploadAsyncResp
- type UploadCompleteResp
- type UploadCreateResp
- type UploadResp
- type UploadUrlResp
- type UserInfoResp
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Api = "https://open-api.123pan.com" AccessToken = InitApiInfo(Api+"/api/v1/access_token", 1) RefreshToken = InitApiInfo(Api+"/api/v1/oauth2/access_token", 1) UserInfo = InitApiInfo(Api+"/api/v1/user/info", 1) FileList = InitApiInfo(Api+"/api/v2/file/list", 4) DownloadInfo = InitApiInfo(Api+"/api/v1/file/download_info", 0) Mkdir = InitApiInfo(Api+"/upload/v1/file/mkdir", 2) Move = InitApiInfo(Api+"/api/v1/file/move", 1) Rename = InitApiInfo(Api+"/api/v1/file/name", 1) Trash = InitApiInfo(Api+"/api/v1/file/trash", 2) UploadCreate = InitApiInfo(Api+"/upload/v1/file/create", 2) UploadUrl = InitApiInfo(Api+"/upload/v1/file/get_upload_url", 0) UploadComplete = InitApiInfo(Api+"/upload/v1/file/upload_complete", 0) UploadAsync = InitApiInfo(Api+"/upload/v1/file/upload_async_result", 1) )
Functions ¶
This section is empty.
Types ¶
type AccessTokenResp ¶
type Addition ¶
type Addition struct {
// refresh_token方式的AccessToken 【对个人开发者暂未开放】
RefreshToken string `json:"RefreshToken" required:"false"`
// 通过 https://www.123pan.com/developer 申请
ClientID string `json:"ClientID" required:"false"`
ClientSecret string `json:"ClientSecret" required:"false"`
// 直接写入AccessToken
AccessToken string `json:"AccessToken" required:"false"`
// 上传线程数
UploadThread int `json:"UploadThread" type:"number" default:"3" help:"the threads of upload"`
driver.RootID
}
type DownloadInfoResp ¶
type File ¶
type File struct {
FileName string `json:"filename"`
Size int64 `json:"size"`
CreateAt string `json:"createAt"`
UpdateAt string `json:"updateAt"`
FileId int64 `json:"fileId"`
Type int `json:"type"`
Etag string `json:"etag"`
S3KeyFlag string `json:"s3KeyFlag"`
ParentFileId int `json:"parentFileId"`
Category int `json:"category"`
Status int `json:"status"`
Trashed int `json:"trashed"`
}
func (File) CreateTime ¶
type FileListResp ¶
type Open123 ¶
func (*Open123) GetAddition ¶
func (d *Open123) GetAddition() driver.Additional
func (*Open123) Put ¶
func (d *Open123) Put(ctx context.Context, dstDir model.Obj, file model.FileStreamer, up driver.UpdateProgress) error
func (*Open123) Upload ¶
func (d *Open123) Upload(ctx context.Context, file model.FileStreamer, createResp *UploadCreateResp, up driver.UpdateProgress) error
type RefreshTokenResp ¶
type UploadAsyncResp ¶
type UploadCompleteResp ¶
type UploadCreateResp ¶
type UploadResp ¶
type UploadResp struct {
BaseResp
Data struct {
AccessKeyId string `json:"AccessKeyId"`
Bucket string `json:"Bucket"`
Key string `json:"Key"`
SecretAccessKey string `json:"SecretAccessKey"`
SessionToken string `json:"SessionToken"`
FileId int64 `json:"FileId"`
Reuse bool `json:"Reuse"`
EndPoint string `json:"EndPoint"`
StorageNode string `json:"StorageNode"`
UploadId string `json:"UploadId"`
} `json:"data"`
}
type UploadUrlResp ¶
type UserInfoResp ¶
type UserInfoResp struct {
BaseResp
Data struct {
UID int64 `json:"uid"`
Username string `json:"username"`
DisplayName string `json:"displayName"`
HeadImage string `json:"headImage"`
Passport string `json:"passport"`
Mail string `json:"mail"`
SpaceUsed int64 `json:"spaceUsed"`
SpacePermanent int64 `json:"spacePermanent"`
SpaceTemp int64 `json:"spaceTemp"`
SpaceTempExpr string `json:"spaceTempExpr"`
Vip bool `json:"vip"`
DirectTraffic int64 `json:"directTraffic"`
IsHideUID bool `json:"isHideUID"`
} `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.