Documentation ¶
Index ¶
- Constants
- func AesECBEncrypt(data, key string) string
- func BoolToNumber(b bool) int
- func MustParseTime(str string) *time.Time
- func MustString(str string, err error) string
- func MustToBytes(b []byte, err error) []byte
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func ParseHttpHeader(str string) map[string]string
- func RsaEncrypt(publicKey, origData string) string
- type Addition
- type AppSessionResp
- type BatchTaskInfo
- type Cloud189File
- type Cloud189FilesResp
- type Cloud189Folder
- type Cloud189PC
- func (y *Cloud189PC) CommonUpload(ctx context.Context, dstDir model.Obj, file model.FileStreamer, ...) (err error)
- func (y *Cloud189PC) Config() driver.Config
- func (y *Cloud189PC) Copy(ctx context.Context, srcObj, dstDir model.Obj) error
- func (y *Cloud189PC) Drop(ctx context.Context) error
- func (y *Cloud189PC) EncryptParams(params Params) string
- func (y *Cloud189PC) FastUpload(ctx context.Context, dstDir model.Obj, file model.FileStreamer, ...) (err error)
- func (y *Cloud189PC) GetAddition() driver.Additional
- func (y *Cloud189PC) Init(ctx context.Context) (err error)
- func (y *Cloud189PC) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)
- func (y *Cloud189PC) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)
- func (y *Cloud189PC) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error
- func (y *Cloud189PC) Move(ctx context.Context, srcObj, dstDir model.Obj) error
- func (y *Cloud189PC) OldUpload(ctx context.Context, dstDir model.Obj, file model.FileStreamer, ...) (err error)
- func (y *Cloud189PC) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, ...) error
- func (y *Cloud189PC) Remove(ctx context.Context, obj model.Obj) error
- func (y *Cloud189PC) Rename(ctx context.Context, srcObj model.Obj, newName string) error
- func (y *Cloud189PC) SignatureHeader(url, method, params string) map[string]string
- type CommitUploadFileResp
- type CreateUploadFileResp
- type EncryptConfResp
- type FamilyInfoListResp
- type FamilyInfoResp
- type GetUploadFileStatusResp
- type InitMultiUploadResp
- type LoginParam
- type LoginResp
- type Params
- type Part
- type RespErr
- type UploadUrlsResp
- type UserSessionResp
Constants ¶
View Source
const ( ACCOUNT_TYPE = "02" APP_ID = "8025431004" CLIENT_TYPE = "10020" VERSION = "6.2" WEB_URL = "https://cloud.189.cn" AUTH_URL = "https://open.e.189.cn" API_URL = "https://api.cloud.189.cn" UPLOAD_URL = "https://upload.cloud.189.cn" RETURN_URL = "https://m.cloud.189.cn/zhuanti/2020/loginErrorPc/index.html" PC = "TELEPC" MAC = "TELEMAC" CHANNEL_ID = "web_cloud.189.cn" )
Variables ¶
This section is empty.
Functions ¶
func BoolToNumber ¶
func MustParseTime ¶
func MustString ¶
func MustToBytes ¶
func PKCS7Padding ¶
func ParseHttpHeader ¶
Types ¶
type Addition ¶
type Addition struct { Username string `json:"username" required:"true"` Password string `json:"password" required:"true"` VCode string `json:"validate_code"` driver.RootID OrderBy string `json:"order_by" type:"select" options:"filename,filesize,lastOpTime" default:"filename"` OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" default:"asc"` Type string `json:"type" type:"select" options:"personal,family" default:"personal"` FamilyID string `json:"family_id"` UploadMethod string `json:"upload_method" type:"select" options:"stream,rapid,old" default:"stream"` NoUseOcr bool `json:"no_use_ocr"` }
type AppSessionResp ¶
type AppSessionResp struct { UserSessionResp IsSaveName string `json:"isSaveName"` // 会话刷新Token AccessToken string `json:"accessToken"` //Token刷新 RefreshToken string `json:"refreshToken"` }
登录返回
type BatchTaskInfo ¶
type BatchTaskInfo struct { // FileId 文件ID FileId string `json:"fileId"` // FileName 文件名 FileName string `json:"fileName"` // IsFolder 是否是文件夹,0-否,1-是 IsFolder int `json:"isFolder"` }
TaskInfo 任务信息
type Cloud189File ¶
type Cloud189File struct { CreateDate string `json:"createDate"` FileCata int64 `json:"fileCata"` Icon struct { //iconOption 5 SmallUrl string `json:"smallUrl"` LargeUrl string `json:"largeUrl"` // iconOption 10 Max600 string `json:"max600"` MediumURL string `json:"mediumUrl"` } `json:"icon"` ID int64 `json:"id"` LastOpTime string `json:"lastOpTime"` Md5 string `json:"md5"` MediaType int `json:"mediaType"` Name string `json:"name"` Orientation int64 `json:"orientation"` Rev string `json:"rev"` Size int64 `json:"size"` StarLabel int64 `json:"starLabel"` // contains filtered or unexported fields }
文件部分 文件
func (*Cloud189File) GetID ¶
func (c *Cloud189File) GetID() string
func (*Cloud189File) GetName ¶
func (c *Cloud189File) GetName() string
func (*Cloud189File) GetPath ¶
func (c *Cloud189File) GetPath() string
func (*Cloud189File) GetSize ¶
func (c *Cloud189File) GetSize() int64
func (*Cloud189File) IsDir ¶
func (c *Cloud189File) IsDir() bool
func (*Cloud189File) ModTime ¶
func (c *Cloud189File) ModTime() time.Time
func (*Cloud189File) Thumb ¶
func (c *Cloud189File) Thumb() string
type Cloud189FilesResp ¶
type Cloud189FilesResp struct { //ResCode int `json:"res_code"` //ResMessage string `json:"res_message"` FileListAO struct { Count int `json:"count"` FileList []Cloud189File `json:"fileList"` FolderList []Cloud189Folder `json:"folderList"` } `json:"fileListAO"` }
type Cloud189Folder ¶
type Cloud189Folder struct { ID int64 `json:"id"` ParentID int64 `json:"parentId"` Name string `json:"name"` FileCata int64 `json:"fileCata"` FileCount int64 `json:"fileCount"` LastOpTime string `json:"lastOpTime"` CreateDate string `json:"createDate"` FileListSize int64 `json:"fileListSize"` Rev string `json:"rev"` StarLabel int64 `json:"starLabel"` // contains filtered or unexported fields }
文件夹
func (*Cloud189Folder) GetID ¶
func (c *Cloud189Folder) GetID() string
func (*Cloud189Folder) GetName ¶
func (c *Cloud189Folder) GetName() string
func (*Cloud189Folder) GetPath ¶
func (c *Cloud189Folder) GetPath() string
func (*Cloud189Folder) GetSize ¶
func (c *Cloud189Folder) GetSize() int64
func (*Cloud189Folder) IsDir ¶
func (c *Cloud189Folder) IsDir() bool
func (*Cloud189Folder) ModTime ¶
func (c *Cloud189Folder) ModTime() time.Time
type Cloud189PC ¶ added in v3.7.1
func (*Cloud189PC) CommonUpload ¶ added in v3.7.1
func (y *Cloud189PC) CommonUpload(ctx context.Context, dstDir model.Obj, file model.FileStreamer, up driver.UpdateProgress) (err error)
普通上传
func (*Cloud189PC) Config ¶ added in v3.7.1
func (y *Cloud189PC) Config() driver.Config
func (*Cloud189PC) EncryptParams ¶ added in v3.18.0
func (y *Cloud189PC) EncryptParams(params Params) string
func (*Cloud189PC) FastUpload ¶ added in v3.7.1
func (y *Cloud189PC) FastUpload(ctx context.Context, dstDir model.Obj, file model.FileStreamer, up driver.UpdateProgress) (err error)
快传
func (*Cloud189PC) GetAddition ¶ added in v3.7.1
func (y *Cloud189PC) GetAddition() driver.Additional
func (*Cloud189PC) Init ¶ added in v3.7.1
func (y *Cloud189PC) Init(ctx context.Context) (err error)
func (*Cloud189PC) OldUpload ¶ added in v3.18.0
func (y *Cloud189PC) OldUpload(ctx context.Context, dstDir model.Obj, file model.FileStreamer, up driver.UpdateProgress) (err error)
func (*Cloud189PC) Put ¶ added in v3.7.1
func (y *Cloud189PC) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) error
func (*Cloud189PC) SignatureHeader ¶ added in v3.18.0
func (y *Cloud189PC) SignatureHeader(url, method, params string) map[string]string
type CommitUploadFileResp ¶ added in v3.18.0
type CreateUploadFileResp ¶ added in v3.18.0
type CreateUploadFileResp struct { // 上传文件请求ID UploadFileId int64 `json:"uploadFileId"` // 上传文件数据的URL路径 FileUploadUrl string `json:"fileUploadUrl"` // 上传文件完成后确认路径 FileCommitUrl string `json:"fileCommitUrl"` // 文件是否已存在云盘中,0-未存在,1-已存在 FileDataExists int `json:"fileDataExists"` }
第二种上传方式
type EncryptConfResp ¶
type EncryptConfResp struct { Result int `json:"result"` Data struct { UpSmsOn string `json:"upSmsOn"` Pre string `json:"pre"` PreDomain string `json:"preDomain"` PubKey string `json:"pubKey"` } `json:"data"` }
登陆加密相关
type FamilyInfoListResp ¶
type FamilyInfoListResp struct {
FamilyInfoResp []FamilyInfoResp `json:"familyInfoResp"`
}
家庭云账户
type FamilyInfoResp ¶
type GetUploadFileStatusResp ¶ added in v3.18.0
type GetUploadFileStatusResp struct { CreateUploadFileResp // 已上传的大小 DataSize int64 `json:"dataSize"` Size int64 `json:"size"` }
func (*GetUploadFileStatusResp) GetSize ¶ added in v3.18.0
func (r *GetUploadFileStatusResp) GetSize() int64
type InitMultiUploadResp ¶
type InitMultiUploadResp struct { //Code string `json:"code"` Data struct { UploadType int `json:"uploadType"` UploadHost string `json:"uploadHost"` UploadFileID string `json:"uploadFileId"` FileDataExists int `json:"fileDataExists"` } `json:"data"` }
上传部分
type LoginParam ¶
type LoginParam struct { // 加密后的用户名和密码 RsaUsername string RsaPassword string // 请求头参数 Lt string ReqId string // 表单参数 ParamId string // 验证码 CaptchaToken string // contains filtered or unexported fields }
登陆需要的参数
type RespErr ¶
type RespErr struct { ResCode any `json:"res_code"` // int or string ResMessage string `json:"res_message"` Error_ string `json:"error"` XMLName xml.Name `xml:"error"` Code string `json:"code" xml:"code"` Message string `json:"message" xml:"message"` Msg string `json:"msg"` ErrorCode string `json:"errorCode"` ErrorMsg string `json:"errorMsg"` }
居然有四种返回方式
type UploadUrlsResp ¶
type UserSessionResp ¶
type UserSessionResp struct { ResCode int `json:"res_code"` ResMessage string `json:"res_message"` LoginName string `json:"loginName"` KeepAlive int `json:"keepAlive"` GetFileDiffSpan int `json:"getFileDiffSpan"` GetUserInfoSpan int `json:"getUserInfoSpan"` // 个人云 SessionKey string `json:"sessionKey"` SessionSecret string `json:"sessionSecret"` // 家庭云 FamilySessionKey string `json:"familySessionKey"` FamilySessionSecret string `json:"familySessionSecret"` }
刷新session返回
Click to show internal directories.
Click to hide internal directories.