Documentation ¶
Index ¶
- Constants
- Variables
- func BuildCustomUserAgent(...) string
- func GetAction(method string, url string) string
- func OssOption(params *S3Params) []oss.Option
- func SplitFile(fileSize int64) (chunks []oss.FileChunk, err error)
- func SplitFileByPartNum(fileSize int64, chunkNum int) ([]oss.FileChunk, error)
- func SplitFileByPartSize(fileSize int64, chunkSize int64) ([]oss.FileChunk, error)
- type Addition
- type CaptchaTokenRequest
- type CaptchaTokenResponse
- type Common
- func (c *Common) GetCaptchaSign() (timestamp, sign string)
- func (c *Common) GetCaptchaToken() string
- func (c *Common) GetDeviceID() string
- func (c *Common) GetUserAgent() string
- func (c *Common) GetUserID() string
- func (c *Common) SetCaptchaToken(captchaToken string)
- func (c *Common) SetDeviceID(deviceID string)
- func (c *Common) SetUserAgent(userAgent string)
- func (c *Common) SetUserID(userID string)
- type ErrResp
- type File
- type Files
- type Media
- type OfflineDownloadResp
- type OfflineListResp
- type OfflineTask
- type Params
- type PikPak
- func (d *PikPak) Config() driver.Config
- func (d *PikPak) Copy(ctx context.Context, srcObj, dstDir model.Obj) error
- func (d *PikPak) DeleteOfflineTasks(ctx context.Context, taskIDs []string, deleteFiles bool) error
- func (d *PikPak) Drop(ctx context.Context) error
- func (d *PikPak) GetAddition() driver.Additional
- func (d *PikPak) Init(ctx context.Context) (err error)
- func (d *PikPak) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)
- func (d *PikPak) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)
- func (d *PikPak) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error
- func (d *PikPak) Move(ctx context.Context, srcObj, dstDir model.Obj) error
- func (d *PikPak) OfflineDownload(ctx context.Context, fileUrl string, parentDir model.Obj, fileName string) (*OfflineTask, error)
- func (d *PikPak) OfflineList(ctx context.Context, nextPageToken string, phase []string) ([]OfflineTask, error)
- func (d *PikPak) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, ...) error
- func (d *PikPak) RefreshCaptchaTokenAtLogin(action, userID string) error
- func (d *PikPak) RefreshCaptchaTokenInLogin(action, username string) error
- func (d *PikPak) Remove(ctx context.Context, obj model.Obj) error
- func (d *PikPak) Rename(ctx context.Context, srcObj model.Obj, newName string) error
- func (d *PikPak) UploadByMultipart(params *S3Params, fileSize int64, stream model.FileStreamer, ...) error
- func (d *PikPak) UploadByOSS(params *S3Params, stream model.FileStreamer, up driver.UpdateProgress) error
- type ReferenceResource
- type S3Params
- type UploadTaskData
Constants ¶
View Source
const ( OSSUserAgent = "aliyun-sdk-android/2.9.13(Linux/Android 14/M2004j7ac;UKQ1.231108.001)" OssSecurityTokenHeaderName = "X-OSS-Security-Token" ThreadsNum = 10 )
View Source
const ( AndroidClientID = "YNxT9w7GMdWvEOKa" AndroidClientSecret = "dbw2OtmVEeuUvIptb1Coyg" AndroidClientVersion = "1.49.3" AndroidPackageName = "com.pikcloud.pikpak" AndroidSdkVersion = "2.0.4.204101" WebClientID = "YUMx5nI8ZU8Ap8pm" WebClientSecret = "dbw2OtmVEeuUvIptb1Coyg" WebClientVersion = "undefined" WebPackageName = "drive.mypikpak.com" WebSdkVersion = "8.0.3" PCClientID = "YvtoWO6GNHiuCl7x" PCClientSecret = "1NIH5R1IEe2pAxZE3hv3uA" PCClientVersion = "undefined" // 2.5.6.4831 PCPackageName = "mypikpak.com" PCSdkVersion = "8.0.3" )
Variables ¶
View Source
var AndroidAlgorithms = []string{
"7xOq4Z8s",
"QE9/9+IQco",
"WdX5J9CPLZp",
"NmQ5qFAXqH3w984cYhMeC5TJR8j",
"cc44M+l7GDhav",
"KxGjo/wHB+Yx8Lf7kMP+/m9I+",
"wla81BUVSmDkctHDpUT",
"c6wMr1sm1WxiR3i8LDAm3W",
"hRLrEQCFNYi0PFPV",
"o1J41zIraDtJPNuhBu7Ifb/q3",
"U",
"RrbZvV0CTu3gaZJ56PVKki4IeP",
"NNuRbLckJqUp1Do0YlrKCUP",
"UUwnBbipMTvInA0U0E9",
"VzGc",
}
View Source
var PCAlgorithms = []string{
"KHBJ07an7ROXDoK7Db",
"G6n399rSWkl7WcQmw5rpQInurc1DkLmLJqE",
"JZD1A3M4x+jBFN62hkr7VDhkkZxb9g3rWqRZqFAAb",
"fQnw/AmSlbbI91Ik15gpddGgyU7U",
"/Dv9JdPYSj3sHiWjouR95NTQff",
"yGx2zuTjbWENZqecNI+edrQgqmZKP",
"ljrbSzdHLwbqcRn",
"lSHAsqCkGDGxQqqwrVu",
"TsWXI81fD1",
"vk7hBjawK/rOSrSWajtbMk95nfgf3",
}
View Source
var WebAlgorithms = []string{
"fyZ4+p77W1U4zcWBUwefAIFhFxvADWtT1wzolCxhg9q7etmGUjXr",
"uSUX02HYJ1IkyLdhINEFcCf7l2",
"iWt97bqD/qvjIaPXB2Ja5rsBWtQtBZZmaHH2rMR41",
"3binT1s/5a1pu3fGsN",
"8YCCU+AIr7pg+yd7CkQEY16lDMwi8Rh4WNp5",
"DYS3StqnAEKdGddRP8CJrxUSFh",
"crquW+4",
"ryKqvW9B9hly+JAymXCIfag5Z",
"Hr08T/NDTX1oSJfHk90c",
"i",
}
Functions ¶
func BuildCustomUserAgent ¶
func SplitFileByPartNum ¶
SplitFileByPartNum splits big file into parts by the num of parts. Split the file with specified parts count, returns the split result when error is nil.
Types ¶
type Addition ¶
type Addition struct { driver.RootID Username string `json:"username" required:"true"` Password string `json:"password" required:"true"` Platform string `json:"platform" required:"true" default:"web" type:"select" options:"android,web,pc"` RefreshToken string `json:"refresh_token" required:"true" default:""` RefreshTokenMethod string `json:"refresh_token_method" required:"true" type:"select" options:"oauth2,http"` CaptchaToken string `json:"captcha_token" default:""` DeviceID string `json:"device_id" required:"false" default:""` DisableMediaLink bool `json:"disable_media_link" default:"true"` }
type CaptchaTokenRequest ¶
type CaptchaTokenResponse ¶
type Common ¶
type Common struct { CaptchaToken string UserID string // 必要值,签名相关 ClientID string ClientSecret string ClientVersion string PackageName string Algorithms []string DeviceID string UserAgent string // 验证码token刷新成功回调 RefreshCTokenCk func(token string) // contains filtered or unexported fields }
func (*Common) GetCaptchaSign ¶
GetCaptchaSign 获取验证码签名
func (*Common) GetCaptchaToken ¶
func (*Common) GetDeviceID ¶
func (*Common) GetUserAgent ¶
func (*Common) SetCaptchaToken ¶
func (*Common) SetDeviceID ¶
func (*Common) SetUserAgent ¶
type ErrResp ¶
type File ¶
type File struct { Id string `json:"id"` Kind string `json:"kind"` Name string `json:"name"` CreatedTime time.Time `json:"created_time"` ModifiedTime time.Time `json:"modified_time"` Hash string `json:"hash"` Size string `json:"size"` ThumbnailLink string `json:"thumbnail_link"` WebContentLink string `json:"web_content_link"` Medias []Media `json:"medias"` }
type Media ¶
type Media struct { MediaId string `json:"media_id"` MediaName string `json:"media_name"` Video struct { Height int `json:"height"` Width int `json:"width"` Duration int `json:"duration"` BitRate int `json:"bit_rate"` FrameRate int `json:"frame_rate"` VideoCodec string `json:"video_codec"` AudioCodec string `json:"audio_codec"` VideoType string `json:"video_type"` } `json:"video"` Link struct { Url string `json:"url"` Token string `json:"token"` Expire time.Time `json:"expire"` } `json:"link"` NeedMoreQuota bool `json:"need_more_quota"` VipTypes []interface{} `json:"vip_types"` RedirectLink string `json:"redirect_link"` IconLink string `json:"icon_link"` IsDefault bool `json:"is_default"` Priority int `json:"priority"` IsOrigin bool `json:"is_origin"` ResolutionName string `json:"resolution_name"` IsVisible bool `json:"is_visible"` Category string `json:"category"` }
type OfflineDownloadResp ¶
type OfflineDownloadResp struct { File *string `json:"file"` Task OfflineTask `json:"task"` UploadType string `json:"upload_type"` URL struct { Kind string `json:"kind"` } `json:"url"` }
添加离线下载响应
type OfflineListResp ¶
type OfflineListResp struct { ExpiresIn int64 `json:"expires_in"` NextPageToken string `json:"next_page_token"` Tasks []OfflineTask `json:"tasks"` }
离线下载列表
type OfflineTask ¶
type OfflineTask struct { Callback string `json:"callback"` CreatedTime string `json:"created_time"` FileID string `json:"file_id"` FileName string `json:"file_name"` FileSize string `json:"file_size"` IconLink string `json:"icon_link"` ID string `json:"id"` Kind string `json:"kind"` Message string `json:"message"` Name string `json:"name"` Params Params `json:"params"` Phase string `json:"phase"` // PHASE_TYPE_RUNNING, PHASE_TYPE_ERROR, PHASE_TYPE_COMPLETE, PHASE_TYPE_PENDING Progress int64 `json:"progress"` ReferenceResource ReferenceResource `json:"reference_resource"` Space string `json:"space"` StatusSize int64 `json:"status_size"` Statuses []string `json:"statuses"` ThirdTaskID string `json:"third_task_id"` Type string `json:"type"` UpdatedTime string `json:"updated_time"` UserID string `json:"user_id"` }
offlineTask
type PikPak ¶
type PikPak struct { model.Storage Addition *Common RefreshToken string AccessToken string // contains filtered or unexported fields }
func (*PikPak) DeleteOfflineTasks ¶
func (*PikPak) GetAddition ¶
func (d *PikPak) GetAddition() driver.Additional
func (*PikPak) OfflineDownload ¶
func (d *PikPak) OfflineDownload(ctx context.Context, fileUrl string, parentDir model.Obj, fileName string) (*OfflineTask, error)
离线下载文件
func (*PikPak) OfflineList ¶
func (d *PikPak) OfflineList(ctx context.Context, nextPageToken string, phase []string) ([]OfflineTask, error)
获取离线下载任务列表 phase 可能的取值: PHASE_TYPE_RUNNING, PHASE_TYPE_ERROR, PHASE_TYPE_COMPLETE, PHASE_TYPE_PENDING
func (*PikPak) Put ¶
func (d *PikPak) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) error
func (*PikPak) RefreshCaptchaTokenAtLogin ¶
RefreshCaptchaTokenAtLogin 刷新验证码token(登录后)
func (*PikPak) RefreshCaptchaTokenInLogin ¶
RefreshCaptchaTokenInLogin 刷新验证码token(登录时)
func (*PikPak) UploadByMultipart ¶
func (d *PikPak) UploadByMultipart(params *S3Params, fileSize int64, stream model.FileStreamer, up driver.UpdateProgress) error
func (*PikPak) UploadByOSS ¶
func (d *PikPak) UploadByOSS(params *S3Params, stream model.FileStreamer, up driver.UpdateProgress) error
type ReferenceResource ¶
type ReferenceResource struct { Type string `json:"@type"` Audit interface{} `json:"audit"` Hash string `json:"hash"` IconLink string `json:"icon_link"` ID string `json:"id"` Kind string `json:"kind"` Medias []Media `json:"medias"` MIMEType string `json:"mime_type"` Name string `json:"name"` Params map[string]interface{} `json:"params"` ParentID string `json:"parent_id"` Phase string `json:"phase"` Size string `json:"size"` Space string `json:"space"` Starred bool `json:"starred"` Tags []string `json:"tags"` ThumbnailLink string `json:"thumbnail_link"` }
Click to show internal directories.
Click to hide internal directories.