Documentation
¶
Overview ¶
This package contains all internal types that you needn't care about. :P
Index ¶
- type ApiError
- type ApiResult
- type BaseApiResult
- type CaptchaSignResult
- type CaptchaSubmitResult
- type DownloadInfoResult
- type ErrorCategory
- type FileAddResult
- type FileData
- type FileIndexResult
- type FileListResult
- type FileOperateResult
- type FilePath
- type FileSearchResult
- type FileStatData
- type FileStatPath
- type FileStatResult
- type FileVideoResult
- type IntString
- type OfflineAddUrlResult
- type OfflineAddUrlsResult
- type OfflineBasicResult
- type OfflineListResult
- type OfflineSpaceResult
- type OfflineTaskData
- type OfflineToken
- type QrcodeApiResult
- type QrcodeLoginData
- type QrcodeStatusData
- type QrcodeTokenData
- type StorageSizeInfo
- type StringFloat64
- type StringInt
- type StringInt64
- type UploadData
- type UploadInitResult
- type UploadResult
- type UserInfoResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiError ¶
type ApiError struct {
Category ErrorCategory
Code int
// contains filtered or unexported fields
}
Common API error
func MakeFileError ¶
func MakeOfflineError ¶
func MakeQrcodeError ¶
type BaseApiResult ¶
type BaseApiResult struct {
State bool `json:"state"`
}
func (*BaseApiResult) IsFailed ¶
func (r *BaseApiResult) IsFailed() bool
type CaptchaSignResult ¶
type CaptchaSignResult struct {
BaseApiResult
Sign string `json:"sign"`
ErrorCode int `json:"errno"`
Error string `json:"error"`
}
type CaptchaSubmitResult ¶
type CaptchaSubmitResult struct {
BaseApiResult
}
type DownloadInfoResult ¶
type DownloadInfoResult struct {
BaseApiResult
UserId int `json:"user_id"`
PickCode string `json:"pick_code"`
FileId string `json:"file_id"`
FileName string `json:"file_name"`
FileSize string `json:"file_size"`
FileUrl string `json:"file_url"`
IsVip int `json:"is_vip"`
IsSnap int `json:"is_snap"`
Is115Chrome int `json:"is_115chrome"`
MessageCode int `json:"msg_code"`
Message string `json:"msg"`
}
type ErrorCategory ¶
type ErrorCategory string
const ( FileError ErrorCategory = "file" OfflineError ErrorCategory = "offline" QrcodeError ErrorCategory = "qrcode" )
type FileAddResult ¶
type FileData ¶
type FileData struct {
AreaId IntString `json:"aid"`
FileId string `json:"fid"`
CategoryId string `json:"cid"`
ParentId string `json:"pid"`
Name string `json:"n"`
Type string `json:"ico"`
Size StringInt64 `json:"s"`
CreateTime string `json:"tp"`
UpdateTime string `json:"te"`
PickCode string `json:"pc"`
Sha1 string `json:"sha"`
// Special fields for video
VideoFlag int `json:"iv"`
VideoDuration float64 `json:"play_long"`
}
type FileIndexResult ¶
type FileIndexResult struct {
BaseApiResult
Code int `json:"code"`
Error string `json:"error"`
Data struct {
SpaceInfo struct {
AllTotal StorageSizeInfo `json:"all_total"`
AllRemain StorageSizeInfo `json:"all_remain"`
AllUsed StorageSizeInfo `json:"all_use"`
} `json:"space_info"`
} `json:"data"`
}
type FileListResult ¶
type FileListResult struct {
BaseApiResult
Error string `json:"error"`
ErrorCode int `json:"errNo"`
AreaId string `json:"aid"`
CategoryId IntString `json:"cid"`
Count int `json:"count"`
SysCount int `json:"sys_count"`
Path []*FilePath `json:"path"`
Data []*FileData `json:"data"`
Order string `json:"order"`
IsAsc int `json:"is_asc"`
Offset int `json:"offset"`
Limit int `json:"limit"`
PageSize int `json:"page_size"`
}
type FileOperateResult ¶
type FileOperateResult struct {
BaseApiResult
ErrorCode StringInt `json:"errno"`
Error string `json:"error"`
}
type FileSearchResult ¶
type FileStatData ¶
type FileStatData struct {
Name string `json:"file_name"`
FileType string `json:"file_category"`
CreateTime string `json:"ptime"`
UpdateTime string `json:"utime"`
FileCount StringInt `json:"count"`
FolderCount StringInt `json:"folder_count"`
FormatSize string `json:"size"`
PickCode string `json:"pick_code"`
Sha1 string `json:"sha1"`
Paths []*FileStatPath `json:"paths"`
}
type FileStatPath ¶
type FileStatResult ¶
type FileStatResult struct {
BaseApiResult
Data *FileStatData
}
func (*FileStatResult) UnmarshalJSON ¶
func (r *FileStatResult) UnmarshalJSON(data []byte) (err error)
type FileVideoResult ¶
type FileVideoResult struct {
BaseApiResult
ErrorCode int `json:"errNo"`
Error string `json:"error"`
FileId string `json:"file_id"`
FileName string `json:"file_name"`
FileSize StringInt64 `json:"file_size"`
FileStatus int `json:"file_status"`
ParentId string `json:"parent_id"`
Width StringInt `json:"width"`
Height StringInt `json:"height"`
Duration StringFloat64 `json:"play_long"`
VideoUrl string `json:"video_url"`
}
type IntString ¶
type IntString string
"IntString" uses for JSON field which's type may be int or string, and store it as string.
func (*IntString) UnmarshalJSON ¶
type OfflineAddUrlResult ¶
type OfflineAddUrlResult struct {
OfflineBasicResult
InfoHash string `json:"info_hash"`
Name string `json:"name"`
Url string `json:"url"`
}
type OfflineAddUrlsResult ¶
type OfflineAddUrlsResult struct {
OfflineBasicResult
Result []*OfflineAddUrlResult `json:"result"`
}
type OfflineBasicResult ¶
type OfflineBasicResult struct {
BaseApiResult
ErrorCode int `json:"errcode"`
ErrorType string `json:"errtype"`
ErrorMsg string `json:"error_msg"`
}
type OfflineListResult ¶
type OfflineListResult struct {
OfflineBasicResult
Count int `json:"count"`
Page int `json:"page"`
PageCount int `json:"page_count"`
PageSize int `json:"page_row"`
QuotaRemain int `json:"quota"`
QuotaTotal int `json:"total"`
Tasks []*OfflineTaskData `json:"tasks"`
}
type OfflineSpaceResult ¶
type OfflineTaskData ¶
type OfflineTaskData struct {
InfoHash string `json:"info_hash"`
Name string `json:"name"`
Size int64 `json:"size"`
Url string `json:"url"`
Status int `json:"status"`
AddTime int64 `json:"add_time"`
LeftTime int64 `json:"left_time"`
UpdateTime int64 `json:"last_update"`
Precent float64 `json:"percentDone"`
Move int `json:"move"`
FileId string `json:"file_id"`
DeleteFileId string `json:"delete_file_id"`
DeletePath string `json:"del_path"`
}
type OfflineToken ¶
type QrcodeApiResult ¶
type QrcodeApiResult struct {
State int `json:"state"`
Code int `json:"code"`
Message string `json:"message"`
Data json.RawMessage `json:"data"`
}
func (*QrcodeApiResult) IsFailed ¶
func (r *QrcodeApiResult) IsFailed() bool
type QrcodeLoginData ¶
type QrcodeLoginData struct {
Cookie struct {
CID string `json:"CID"`
SEID string `json:"SEID"`
UID string `json:"UID"`
} `json:"cookie"`
UserId int `json:"user_id"`
UserName string `json:"user_name"`
Email string `json:"email"`
Mobile string `json:"mobile"`
Country string `json:"country"`
From string `json:"from"`
}
type QrcodeStatusData ¶
type QrcodeTokenData ¶
type StorageSizeInfo ¶
type StringFloat64 ¶
type StringFloat64 float64
func (*StringFloat64) UnmarshalJSON ¶
func (v *StringFloat64) UnmarshalJSON(b []byte) (err error)
type StringInt ¶
type StringInt int
"IntString" uses for JSON field which's type may be string or int, and store it as int.
func (*StringInt) UnmarshalJSON ¶
type StringInt64 ¶
type StringInt64 int64
"StringInt64" uses for JSON field which's type may be int64 or string, and store it as int64.
func (*StringInt64) UnmarshalJSON ¶
func (v *StringInt64) UnmarshalJSON(b []byte) (err error)
type UploadData ¶
type UploadData struct {
AreaId int `json:"aid"`
CategoryId string `json:"cid"`
FileId string `json:"file_id"`
FileName string `json:"file_name"`
FileSize StringInt64 `json:"file_size"`
FileStatus int `json:"file_status"`
FileType int `json:"file_type"`
CreateTime int64 `json:"file_ptime"`
IsVideo int `json:"is_video"`
PickCode string `json:"pick_code"`
Sha1 string `json:"sha1"`
}
type UploadInitResult ¶
type UploadResult ¶
type UploadResult struct {
BaseApiResult
Code int `json:"code"`
Message string `json:"message"`
Data *UploadData `json:"data"`
}
type UserInfoResult ¶
type UserInfoResult struct {
BaseApiResult
Data struct {
UserId int `json:"user_id"`
UserName string `json:"user_name"`
UserAvatar string `json:"face"`
Device int `json:"device"`
Rank int `json:"rank"`
VipFlag int `json:"vip"`
VipExpire int64 `json:"expire"`
Global int `json:"global"`
Forever int `json:"forever"`
IsPrivilege bool `json:"is_privilege"`
Privilege struct {
State bool `json:"state"`
Start int `json:"start"`
Expire int `json:"expire"`
} `json:"privilege"`
} `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.