Documentation
¶
Index ¶
- Variables
- type CompleteMultipartUpload
- type File
- type FileStat
- type OssArgs
- type Part
- type PikPak
- func (p *PikPak) AuthCaptchaToken(action string) error
- func (p *PikPak) CreateFolder(parentId, dir string) (string, error)
- func (p *PikPak) CreateShaFile(parentId, fileName, size, sha string) error
- func (p *PikPak) CreateUrlFile(parentId, url string) error
- func (p *PikPak) GetDeepFolderId(parentId string, dirPath string) (string, error)
- func (p *PikPak) GetDeepFolderOrCreateId(parentId string, dirPath string) (string, error)
- func (p *PikPak) GetFile(fileId string) (File, error)
- func (p *PikPak) GetFileStat(parentId string, name string) (FileStat, error)
- func (p *PikPak) GetFolderFileStatList(parentId string) ([]FileStat, error)
- func (p *PikPak) GetFolderId(parentId string, dir string) (string, error)
- func (p *PikPak) GetPathFolderId(dirPath string) (string, error)
- func (p *PikPak) GetQuota() (Quota, error)
- func (p *PikPak) Login() error
- func (p *PikPak) RefreshToken() error
- func (p *PikPak) UploadFile(parentId, path string) error
- type Quota
- type Quotas
Constants ¶
This section is empty.
Variables ¶
View Source
var Concurrent int64 = 1 << 4
View Source
var ErrNotFoundFolder = errors.New("not found pikpak folder")
Functions ¶
This section is empty.
Types ¶
type CompleteMultipartUpload ¶
type CompleteMultipartUpload struct {
Part []Part `xml:"Part"`
}
type File ¶
type File struct {
FileStat
Revision string `json:"revision"`
Starred bool `json:"starred"`
WebContentLink string `json:"web_content_link"`
Links struct {
ApplicationOctetStream struct {
URL string `json:"url"`
Token string `json:"token"`
Expire time.Time `json:"expire"`
} `json:"application/octet-stream"`
} `json:"links"`
Audit struct {
Status string `json:"status"`
Message string `json:"message"`
Title string `json:"title"`
} `json:"audit"`
Medias []struct {
MediaID string `json:"media_id"`
MediaName string `json:"media_name"`
Video interface{} `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"`
} `json:"medias"`
Trashed bool `json:"trashed"`
DeleteTime string `json:"delete_time"`
OriginalURL string `json:"original_url"`
Params struct {
Platform string `json:"platform"`
PlatformIcon string `json:"platform_icon"`
} `json:"params"`
OriginalFileIndex int `json:"original_file_index"`
Space string `json:"space"`
Apps []interface{} `json:"apps"`
Writable bool `json:"writable"`
FolderType string `json:"folder_type"`
Collection interface{} `json:"collection"`
}
type FileStat ¶
type FileStat struct {
Kind string `json:"kind"`
ID string `json:"id"`
ParentID string `json:"parent_id"`
Name string `json:"name"`
UserID string `json:"user_id"`
Size string `json:"size"`
FileExtension string `json:"file_extension"`
MimeType string `json:"mime_type"`
CreatedTime time.Time `json:"created_time"`
ModifiedTime time.Time `json:"modified_time"`
IconLink string `json:"icon_link"`
ThumbnailLink string `json:"thumbnail_link"`
Md5Checksum string `json:"md5_checksum"`
Hash string `json:"hash"`
Phase string `json:"phase"`
}
type PikPak ¶
type PikPak struct {
Account string `json:"account"`
Password string `json:"password"`
JwtToken string `json:"token"`
CaptchaToken string `json:"captchaToken"`
Sub string `json:"userId"`
DeviceId string `json:"deviceId"`
RefreshSecond int64 `json:"refreshSecond"`
// contains filtered or unexported fields
}
func (*PikPak) AuthCaptchaToken ¶
func (*PikPak) CreateFolder ¶
Create new folder in parent folder parentId is parent folder id
func (*PikPak) CreateShaFile ¶
func (*PikPak) CreateUrlFile ¶
func (*PikPak) GetDeepFolderId ¶
获取文件夹 id dir 可以包括 /. 若以 / 开头,函数会去除 /, 且会从 parent 目录开始查找
func (*PikPak) GetDeepFolderOrCreateId ¶
func (*PikPak) GetFileStat ¶
Find FileState similar to name in the parentId directory
func (*PikPak) GetFolderFileStatList ¶
func (*PikPak) GetFolderId ¶
获取文件夹 id dir 不能包括 /
func (*PikPak) RefreshToken ¶
func (*PikPak) UploadFile ¶
Click to show internal directories.
Click to hide internal directories.