protocol

package
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CookieUrl = "https://115.com"

	CookieNameUID  = "UID"
	CookieNameCID  = "CID"
	CookieNameSEID = "SEID"
)
View Source
const (
	FileListLimit = 32
)
View Source
const (
	LabelListLimit = 30
)

Variables

View Source
var (
	CookieDomains = []string{
		".115.com",
		".anxia.com",
	}
)

Functions

func MakeUserAgent added in v0.6.1

func MakeUserAgent(name, appVer string) string

Types

type BasicResp added in v0.6.1

type BasicResp struct {
	// Response state
	State bool `json:"state"`
	// Possible error code fields
	ErrorCode  util.IntNumber `json:"errno,omitempty"`
	ErrorCode2 int            `json:"errNo,omitempty"`
	ErrorCode3 int            `json:"errcode,omitempty"`
	ErrorCode4 int            `json:"errCode,omitempty"`
	ErrorCode5 int            `json:"code,omitempty"`
	// Possible error message fields
	ErrorMessage  string `json:"error,omitempty"`
	ErrorMessage2 string `json:"message,omitempty"`
	ErrorMessage3 string `json:"error_msg,omitempty"`
}

_BasicResp is the basic response for most JSON/JSONP API.

func (*BasicResp) Err added in v0.6.1

func (r *BasicResp) Err() error

type DirCreateResp added in v0.6.1

type DirCreateResp struct {
	BasicResp

	FileId   string `json:"file_id"`
	FileName string `json:"file_name"`
}

func (*DirCreateResp) Extract added in v0.6.1

func (r *DirCreateResp) Extract(v any) (err error)

type DirLocateResp added in v0.6.1

type DirLocateResp struct {
	BasicResp

	DirId     string `json:"id"`
	IsPrivate string `json:"is_private"`
}

func (*DirLocateResp) Extract added in v0.6.1

func (r *DirLocateResp) Extract(v any) (err error)

type FileListResp added in v0.6.1

type FileListResp struct {
	StandardResp

	AreaId     string         `json:"aid"`
	CategoryId util.IntNumber `json:"cid"`

	Count int `json:"count"`

	Order string `json:"order"`
	IsAsc int    `json:"is_asc"`

	Offset int `json:"offset"`
	Limit  int `json:"limit"`
}

func (*FileListResp) Err added in v0.6.1

func (r *FileListResp) Err() (err error)

func (*FileListResp) Extract added in v0.6.1

func (r *FileListResp) Extract(v any) (err error)

type FileSearchResp added in v0.6.1

type FileSearchResp struct {
	StandardResp

	Folder struct {
		CategoryId string `json:"cid"`
		ParentId   string `json:"pid"`
		Name       string `json:"name"`
	} `json:"folder"`

	Count       int `json:"count"`
	FileCount   int `json:"file_count"`
	FolderCount int `json:"folder_count"`

	Order string `json:"order"`
	IsAsc int    `json:"is_asc"`

	Offset int `json:"offset"`
	Limit  int `json:"page_size"`
}

func (*FileSearchResp) Extract added in v0.6.1

func (r *FileSearchResp) Extract(v any) (err error)

type OfflineListResp added in v0.6.1

type OfflineListResp struct {
	BasicResp

	PageIndex int `json:"page"`
	PageCount int `json:"page_count"`
	PageSize  int `json:"page_row"`

	QuotaTotal  int `json:"total"`
	QuotaRemain int `json:"quota"`

	TaskCount int                  `json:"count"`
	Tasks     []*types.OfflineTask `json:"tasks"`
}

func (*OfflineListResp) Extract added in v0.6.1

func (r *OfflineListResp) Extract(v any) (err error)

type QrcodeBaseResp added in v0.6.1

type QrcodeBaseResp struct {
	State         int    `json:"state"`
	ErrorCode1    int    `json:"code"`
	ErrorCode2    int    `json:"errno"`
	ErrorMessage1 string `json:"message"`
	ErrorMessage2 string `json:"error"`

	Data json.RawMessage `json:"data"`
}

func (*QrcodeBaseResp) Err added in v0.6.1

func (r *QrcodeBaseResp) Err() error

func (*QrcodeBaseResp) Extract added in v0.6.1

func (r *QrcodeBaseResp) Extract(v any) error

type RecycleBinListResp added in v0.6.1

type RecycleBinListResp struct {
	StandardResp

	Count util.IntNumber `json:"count"`

	Offset int `json:"offset"`
	Limit  int `json:"page_size"`
}

func (*RecycleBinListResp) Extract added in v0.6.1

func (r *RecycleBinListResp) Extract(v any) (err error)

type ShareListResp added in v0.6.1

type ShareListResp struct {
	BasicResp

	Count int             `json:"count"`
	List  json.RawMessage `json:"list"`
}

func (*ShareListResp) Extract added in v0.6.1

func (r *ShareListResp) Extract(v any) (err error)

type StandardResp added in v0.6.1

type StandardResp struct {
	BasicResp

	Data json.RawMessage `json:"data"`
}

StandardResp is the response for all JSON/JSONP APIs with "data" field.

func (*StandardResp) Extract added in v0.6.1

func (r *StandardResp) Extract(v any) error

type UploadInfoResp added in v0.6.1

type UploadInfoResp struct {
	BasicResp

	UserId  int    `json:"user_id"`
	UserKey string `json:"userkey"`
}

func (*UploadInfoResp) Extract added in v0.6.1

func (r *UploadInfoResp) Extract(v any) error

type UploadInitResp added in v0.6.1

type UploadInitResp struct {
	Request   string `json:"request"`
	Version   string `json:"version"`
	ErrorCode int    `json:"statuscode"`
	ErrorMsg  string `json:"statusmsg"`

	Status   int    `json:"status"`
	PickCode string `json:"pickcode"`

	// New fields in upload v4.0
	SignKey   string `json:"sign_key"`
	SignCheck string `json:"sign_check"`

	// OSS upload fields
	Bucket   string `json:"bucket"`
	Object   string `json:"object"`
	Callback struct {
		Callback    string `json:"callback"`
		CallbackVar string `json:"callback_var"`
	} `json:"callback"`

	// Useless fields
	FileId   int    `json:"fileid"`
	FileInfo string `json:"fileinfo"`
	Target   string `json:"target"`
}

func (*UploadInitResp) Err added in v0.6.1

func (r *UploadInitResp) Err() error

func (*UploadInitResp) Extract added in v0.6.1

func (r *UploadInitResp) Extract(v any) (err error)

type UploadSampleInitResp added in v0.6.1

type UploadSampleInitResp struct {
	Host        string `json:"host"`
	Object      string `json:"object"`
	Callback    string `json:"callback"`
	AccessKeyId string `json:"accessid"`
	Policy      string `json:"policy"`
	Signature   string `json:"signature"`
	Expire      int64  `json:"expire"`
}

func (*UploadSampleInitResp) Err added in v0.6.1

func (r *UploadSampleInitResp) Err() error

func (*UploadSampleInitResp) Extract added in v0.6.1

func (r *UploadSampleInitResp) Extract(v any) error

type UploadTokenResp added in v0.6.1

type UploadTokenResp struct {
	StatusCode      string `json:"StatusCode"`
	AccessKeyId     string `json:"AccessKeyId"`
	AccessKeySecret string `json:"AccessKeySecret"`
	SecurityToken   string `json:"SecurityToken"`
	Expiration      string `json:"Expiration"`
}

func (*UploadTokenResp) Err added in v0.6.1

func (r *UploadTokenResp) Err() error

func (*UploadTokenResp) Extract added in v0.6.1

func (r *UploadTokenResp) Extract(v any) error

type VideoPlayWebResp added in v0.6.1

type VideoPlayWebResp struct {
	BasicResp

	FileId        string           `json:"file_id"`
	ParentId      string           `json:"parent_id"`
	FileName      string           `json:"file_name"`
	FileSize      util.IntNumber   `json:"file_size"`
	FileSha1      string           `json:"sha1"`
	PickCode      string           `json:"pick_code"`
	FileStatus    int              `json:"file_status"`
	VideoDuration util.FloatNumner `json:"play_long"`
	VideoWidth    util.IntNumber   `json:"width"`
	VideoHeight   util.IntNumber   `json:"height"`
	VideoUrl      string           `json:"video_url"`
}

func (*VideoPlayWebResp) Extract added in v0.6.1

func (r *VideoPlayWebResp) Extract(v any) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL