Documentation
¶
Index ¶
- Constants
- Variables
- func AesECBEncrypt(data, key string) string
- func BoolToNumber(b bool) int
- func IF[V any](o bool, t V, f V) V
- func MustParseTime(str string) *time.Time
- func MustString(str string, err error) string
- 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 BatchTaskConflictTaskInfoResp
- type BatchTaskInfo
- type BatchTaskStateResp
- type Cloud189File
- func (c *Cloud189File) CreateTime() time.Time
- func (c *Cloud189File) GetHash() utils.HashInfo
- func (c *Cloud189File) GetID() string
- func (c *Cloud189File) GetName() string
- func (c *Cloud189File) GetPath() string
- func (c *Cloud189File) GetSize() int64
- func (c *Cloud189File) IsDir() bool
- func (c *Cloud189File) ModTime() time.Time
- func (c *Cloud189File) Thumb() string
- type Cloud189FilesResp
- type Cloud189Folder
- func (c *Cloud189Folder) CreateTime() time.Time
- func (c *Cloud189Folder) GetHash() utils.HashInfo
- func (c *Cloud189Folder) GetID() string
- func (c *Cloud189Folder) GetName() string
- func (c *Cloud189Folder) GetPath() string
- func (c *Cloud189Folder) GetSize() int64
- func (c *Cloud189Folder) IsDir() bool
- func (c *Cloud189Folder) ModTime() time.Time
- type Cloud189PC
- func (y *Cloud189PC) CheckBatchTask(aType string, taskID string) (*BatchTaskStateResp, error)
- func (y *Cloud189PC) Config() driver.Config
- func (y *Cloud189PC) Copy(ctx context.Context, srcObj, dstDir model.Obj) error
- func (y *Cloud189PC) CreateBatchTask(aType string, familyID string, targetFolderId string, other map[string]string, ...) (*CreateBatchTaskResp, error)
- func (y *Cloud189PC) Delete(ctx context.Context, familyId string, srcObj model.Obj) error
- func (y *Cloud189PC) Drop(ctx context.Context) error
- func (y *Cloud189PC) EncryptParams(params Params, isFamily bool) string
- func (y *Cloud189PC) FastUpload(ctx context.Context, dstDir model.Obj, file model.FileStreamer, ...) (model.Obj, error)
- func (y *Cloud189PC) GetAddition() driver.Additional
- func (y *Cloud189PC) GetConflictTaskInfo(aType string, taskID string) (*BatchTaskConflictTaskInfoResp, error)
- func (y *Cloud189PC) GetMultiUploadUrls(ctx context.Context, isFamily bool, uploadFileId string, partInfo ...string) ([]UploadUrlInfo, error)
- func (y *Cloud189PC) Init(ctx context.Context) (err error)
- func (y *Cloud189PC) InitReference(storage driver.Driver) 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) (model.Obj, error)
- func (y *Cloud189PC) ManageBatchTask(aType string, taskID string, targetFolderId string, taskInfos ...BatchTaskInfo) error
- func (y *Cloud189PC) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)
- func (y *Cloud189PC) OldUpload(ctx context.Context, dstDir model.Obj, file model.FileStreamer, ...) (model.Obj, error)
- func (y *Cloud189PC) OldUploadCommit(ctx context.Context, fileCommitUrl string, uploadFileID int64, isFamily bool, ...) (model.Obj, error)
- func (y *Cloud189PC) OldUploadCreate(ctx context.Context, parentID string, fileMd5, fileName, fileSize string, ...) (*CreateUploadFileResp, error)
- func (y *Cloud189PC) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, ...) (newObj model.Obj, err error)
- func (y *Cloud189PC) RapidUpload(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, ...) (model.Obj, error)
- func (y *Cloud189PC) Remove(ctx context.Context, obj model.Obj) error
- func (y *Cloud189PC) Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error)
- func (y *Cloud189PC) SaveFamilyFileToPersonCloud(ctx context.Context, familyId string, srcObj, dstDir model.Obj, overwrite bool) error
- func (y *Cloud189PC) SignatureHeader(url, method, params string, isFamily bool) map[string]string
- func (y *Cloud189PC) StreamUpload(ctx context.Context, dstDir model.Obj, file model.FileStreamer, ...) (model.Obj, error)
- func (y *Cloud189PC) WaitBatchTask(aType string, taskID string, t time.Duration) error
- type CommitMultiUploadFileResp
- type CreateBatchTaskResp
- type CreateUploadFileResp
- type EncryptConfResp
- type FamilyInfoListResp
- type FamilyInfoResp
- type GetUploadFileStatusResp
- type InitMultiUploadResp
- type LoginParam
- type LoginResp
- type OldCommitUploadFileResp
- type Params
- type RespErr
- type String
- type Time
- type UploadProgress
- type UploadUrlInfo
- type UploadUrlsData
- type UploadUrlsResp
- type UserSessionResp
- type WrapFileStreamer
Constants ¶
const ( PC = "TELEPC" // PC客户端标识 MAC = "TELEMAC" // MAC客户端标识 )
常量定义,包含189云盘的账户类型、应用ID、客户端类型、版本号及相关URL
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" CHANNEL_ID = "web_cloud.189.cn" )
Variables ¶
var ErrIsConflict = errors.New("there is a conflict with the target object")
Functions ¶
func MustParseTime ¶
MustParseTime 解析时间字符串为时间对象 参数:
- str: 时间字符串,格式为 "2006-01-02 15:04:05"
返回值: 解析后的时间对象指针
func ParseHttpHeader ¶
ParseHttpHeader 解析HTTP头部字符串为映射 参数:
- str: HTTP头部字符串,格式为 "key1=value1&key2=value2"
返回值: 解析后的头部映射
func RsaEncrypt ¶
RsaEncrypt 使用RSA加密数据 使用公钥对原始数据进行加密 参数:
- publicKey: PEM格式的RSA公钥
- origData: 要加密的原始数据
返回值: 大写的十六进制加密字符串
Types ¶
type Addition ¶
type Addition struct {
driver.RootID
Username string `json:"username" required:"true"` // 用户名,用于登录189云盘
Password string `json:"password" required:"true"` // 密码,用于登录189云盘
ValidateCode string `json:"validate_code"` // 验证码,用于额外的身份验证
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"` // 家庭ID,当类型为家庭时使用
UploadMethod string `json:"upload_method" type:"select" options:"stream,rapid,old" default:"stream"` // 上传方法,流式、快速或旧版
UploadThread string `json:"upload_thread" default:"3" help:"1<=thread<=32"` // 上传线程数,范围1到32
FamilyTransfer bool `json:"family_transfer"` // 是否启用家庭账户文件转移
RapidUpload bool `json:"rapid_upload"` // 是否启用快速上传模式
NoUseOcr bool `json:"no_use_ocr"` // 是否禁用OCR功能
}
Addition 存储189云盘的配置信息,包含用户凭据、排序规则、上传方式等设置。
type AppSessionResp ¶
type AppSessionResp struct {
UserSessionResp
IsSaveName string `json:"isSaveName"` // 是否保存用户名
// 会话刷新令牌
AccessToken string `json:"accessToken"` // 访问令牌,用于API调用
// 令牌刷新
RefreshToken string `json:"refreshToken"` // 刷新令牌,用于更新访问令牌
}
AppSessionResp 登录返回的会话信息,包含访问令牌和刷新令牌。
type BatchTaskConflictTaskInfoResp ¶
type BatchTaskConflictTaskInfoResp struct {
SessionKey string `json:"sessionKey"` // 会话密钥
TargetFolderID int `json:"targetFolderId"` // 目标文件夹ID
TaskID string `json:"taskId"` // 任务ID
TaskInfos []BatchTaskInfo // 任务信息列表
TaskType int `json:"taskType"` // 任务类型
}
BatchTaskConflictTaskInfoResp 批量任务冲突信息响应,包含任务ID和冲突文件信息。
type BatchTaskInfo ¶
type BatchTaskInfo struct {
// FileID 文件ID
FileID string `json:"fileId"`
// FileName 文件名
FileName string `json:"fileName"`
// IsFolder 是否是文件夹,0-否,1-是
IsFolder int `json:"isFolder"`
// SrcParentID 文件所在父目录ID
SrcParentID string `json:"srcParentId,omitempty"`
/* 冲突管理 */
// 1 -> 跳过 2 -> 保留 3 -> 覆盖
DealWay int `json:"dealWay,omitempty"`
IsConflict int `json:"isConflict,omitempty"`
}
BatchTaskInfo 批量任务信息
type BatchTaskStateResp ¶
type BatchTaskStateResp struct {
FailedCount int `json:"failedCount"`
Process int `json:"process"`
SkipCount int `json:"skipCount"`
SubTaskCount int `json:"subTaskCount"`
SuccessedCount int `json:"successedCount"`
SuccessedFileIDList []int64 `json:"successedFileIdList"`
TaskID string `json:"taskId"`
TaskStatus int `json:"taskStatus"` // 1 初始化 2 存在冲突 3 执行中,4 完成
}
BatchTaskStateResp 批量任务状态响应
type Cloud189File ¶
type Cloud189File struct {
ID String `json:"id"` // 文件ID
Name string `json:"name"` // 文件名称
Size int64 `json:"size"` // 文件大小
Md5 string `json:"md5"` // 文件MD5值
LastOpTime Time `json:"lastOpTime"` // 最后操作时间
CreateDate Time `json:"createDate"` // 创建时间
Icon struct {
// iconOption 5
SmallURL string `json:"smallUrl"` // 小图标URL
LargeURL string `json:"largeUrl"` // 大图标URL
// iconOption 10
Max600 string `json:"max600"` // 最大600尺寸图标URL
MediumURL string `json:"mediumUrl"` // 中等尺寸图标URL
} `json:"icon"` // 图标信息
}
Cloud189File 表示189云盘中的文件,包含文件的基本信息和图标链接。
func (*Cloud189File) CreateTime ¶
func (c *Cloud189File) CreateTime() time.Time
CreateTime 获取文件的创建时间。
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"`
}
Cloud189FilesResp 文件列表响应
type Cloud189Folder ¶
type Cloud189Folder struct {
ID String `json:"id"` // 文件夹ID
ParentID int64 `json:"parentId"` // 父文件夹ID
Name string `json:"name"` // 文件夹名称
LastOpTime Time `json:"lastOpTime"` // 最后操作时间
CreateDate Time `json:"createDate"` // 创建时间
}
Cloud189Folder 表示189云盘中的文件夹,包含文件夹的基本信息。
func (*Cloud189Folder) CreateTime ¶
func (c *Cloud189Folder) CreateTime() time.Time
CreateTime 获取文件夹的创建时间。
func (*Cloud189Folder) GetHash ¶
func (c *Cloud189Folder) GetHash() utils.HashInfo
GetHash 获取文件夹的哈希信息(文件夹没有哈希)。
type Cloud189PC ¶
Cloud189PC 天翼云盘PC客户端驱动实现
func (*Cloud189PC) CheckBatchTask ¶
func (y *Cloud189PC) CheckBatchTask(aType string, taskID string) (*BatchTaskStateResp, error)
检测任务状态
func (*Cloud189PC) Copy ¶
Copy 复制文件或文件夹 将文件或文件夹复制到新的目录 参数:
- ctx: 上下文
- srcObj: 源文件或文件夹对象
- dstDir: 目标目录对象
返回值: 错误信息
func (*Cloud189PC) CreateBatchTask ¶
func (y *Cloud189PC) CreateBatchTask(aType string, familyID string, targetFolderId string, other map[string]string, taskInfos ...BatchTaskInfo) (*CreateBatchTaskResp, error)
func (*Cloud189PC) Drop ¶
func (y *Cloud189PC) Drop(ctx context.Context) error
Drop 清除引用 参数:
- ctx: 上下文
返回值: 错误信息
func (*Cloud189PC) EncryptParams ¶
func (y *Cloud189PC) EncryptParams(params Params, isFamily bool) string
func (*Cloud189PC) FastUpload ¶
func (y *Cloud189PC) FastUpload(ctx context.Context, dstDir model.Obj, file model.FileStreamer, up driver.UpdateProgress, isFamily bool, overwrite bool) (model.Obj, error)
快传
func (*Cloud189PC) GetAddition ¶
func (y *Cloud189PC) GetAddition() driver.Additional
GetAddition 获取附加配置 返回值: 驱动附加配置
func (*Cloud189PC) GetConflictTaskInfo ¶
func (y *Cloud189PC) GetConflictTaskInfo(aType string, taskID string) (*BatchTaskConflictTaskInfoResp, error)
获取冲突的任务信息
func (*Cloud189PC) GetMultiUploadUrls ¶
func (y *Cloud189PC) GetMultiUploadUrls(ctx context.Context, isFamily bool, uploadFileId string, partInfo ...string) ([]UploadUrlInfo, error)
获取上传切片信息 对http body有大小限制,分片信息太多会出错
func (*Cloud189PC) Init ¶
func (y *Cloud189PC) Init(ctx context.Context) (err error)
Init 初始化驱动 初始化客户端、登录状态、家庭云ID等 参数:
- ctx: 上下文
返回值: 错误信息
func (*Cloud189PC) InitReference ¶
func (y *Cloud189PC) InitReference(storage driver.Driver) error
InitReference 初始化引用 用于在多个存储实例之间共享登录状态 参数:
- storage: 要引用的驱动实例
返回值: 错误信息
func (*Cloud189PC) Link ¶
func (y *Cloud189PC) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)
Link 获取文件下载链接 参数:
- ctx: 上下文
- file: 文件对象
- args: 链接参数
返回值: 下载链接,错误信息
func (*Cloud189PC) List ¶
func (y *Cloud189PC) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)
List 列出目录内容 获取指定目录下的所有文件和文件夹 参数:
- ctx: 上下文
- dir: 目录对象
- args: 列表参数
返回值: 文件和文件夹对象列表,错误信息
func (*Cloud189PC) MakeDir ¶
func (y *Cloud189PC) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error)
MakeDir 创建目录 在指定目录下创建新的文件夹 参数:
- ctx: 上下文
- parentDir: 父目录对象
- dirName: 新目录名称
返回值: 新创建的目录对象,错误信息
func (*Cloud189PC) ManageBatchTask ¶
func (y *Cloud189PC) ManageBatchTask(aType string, taskID string, targetFolderId string, taskInfos ...BatchTaskInfo) error
处理冲突
func (*Cloud189PC) Move ¶
Move 移动文件或文件夹 将文件或文件夹移动到新的目录 参数:
- ctx: 上下文
- srcObj: 源文件或文件夹对象
- dstDir: 目标目录对象
返回值: 移动后的对象,错误信息
func (*Cloud189PC) OldUpload ¶
func (y *Cloud189PC) OldUpload(ctx context.Context, dstDir model.Obj, file model.FileStreamer, up driver.UpdateProgress, isFamily bool, overwrite bool) (model.Obj, error)
旧版本上传,家庭云不支持覆盖
func (*Cloud189PC) OldUploadCommit ¶
func (y *Cloud189PC) OldUploadCommit(ctx context.Context, fileCommitUrl string, uploadFileID int64, isFamily bool, overwrite bool) (model.Obj, error)
提交上传文件
func (*Cloud189PC) OldUploadCreate ¶
func (y *Cloud189PC) OldUploadCreate(ctx context.Context, parentID string, fileMd5, fileName, fileSize string, isFamily bool) (*CreateUploadFileResp, error)
创建上传会话
func (*Cloud189PC) Put ¶
func (y *Cloud189PC) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) (newObj model.Obj, err error)
Put 上传文件 将文件上传到指定目录 参数:
- ctx: 上下文
- dstDir: 目标目录对象
- stream: 文件流
- up: 上传进度回调
返回值: 上传后的文件对象,错误信息
func (*Cloud189PC) RapidUpload ¶
func (*Cloud189PC) Rename ¶
func (y *Cloud189PC) Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error)
Rename 重命名文件或文件夹 参数:
- ctx: 上下文
- srcObj: 要重命名的文件或文件夹对象
- newName: 新名称
返回值: 重命名后的对象,错误信息
func (*Cloud189PC) SaveFamilyFileToPersonCloud ¶
func (y *Cloud189PC) SaveFamilyFileToPersonCloud(ctx context.Context, familyId string, srcObj, dstDir model.Obj, overwrite bool) error
保存家庭云中的文件到个人云
func (*Cloud189PC) SignatureHeader ¶
func (y *Cloud189PC) SignatureHeader(url, method, params string, isFamily bool) map[string]string
func (*Cloud189PC) StreamUpload ¶
func (y *Cloud189PC) StreamUpload(ctx context.Context, dstDir model.Obj, file model.FileStreamer, up driver.UpdateProgress, isFamily bool, overwrite bool) (model.Obj, error)
普通上传 无法上传大小为0的文件
func (*Cloud189PC) WaitBatchTask ¶
等待任务完成
type CommitMultiUploadFileResp ¶
type CommitMultiUploadFileResp struct {
File struct {
UserFileID String `json:"userFileId"`
FileName string `json:"fileName"`
FileSize int64 `json:"fileSize"`
FileMd5 string `json:"fileMd5"`
CreateDate Time `json:"createDate"`
} `json:"file"`
}
CommitMultiUploadFileResp 提交分片上传文件的响应
type CreateBatchTaskResp ¶
type CreateBatchTaskResp struct {
TaskID string `json:"taskId"`
}
CreateBatchTaskResp 创建批量任务的响应
type CreateUploadFileResp ¶
type CreateUploadFileResp struct {
// 上传文件请求ID
UploadFileID int64 `json:"uploadFileId"`
// 上传文件数据的URL路径
FileUploadURL string `json:"fileUploadUrl"`
// 上传文件完成后确认路径
FileCommitURL string `json:"fileCommitUrl"`
// 文件是否已存在云盘中,0-未存在,1-已存在
FileDataExists int `json:"fileDataExists"`
}
CreateUploadFileResp 创建上传文件的响应
type EncryptConfResp ¶
type EncryptConfResp struct {
Result int `json:"result"` // 请求结果代码,0表示成功
Data struct {
UpSmsOn string `json:"upSmsOn"` // 是否需要短信验证
Pre string `json:"pre"` // 前缀信息
PreDomain string `json:"preDomain"` // 前缀域名
PubKey string `json:"pubKey"` // RSA公钥,用于加密用户名和密码
} `json:"data"` // 响应数据
}
EncryptConfResp 登录加密相关配置响应,包含加密公钥等信息。
type FamilyInfoListResp ¶
type FamilyInfoListResp struct {
FamilyInfoResp []FamilyInfoResp `json:"familyInfoResp"` // 家庭账户信息列表
}
FamilyInfoListResp 家庭云账户列表响应,包含多个家庭账户信息。
type FamilyInfoResp ¶
type FamilyInfoResp struct {
Count int `json:"count"` // 成员数量
CreateTime string `json:"createTime"` // 创建时间
FamilyID int64 `json:"familyId"` // 家庭ID
RemarkName string `json:"remarkName"` // 备注名称
Type int `json:"type"` // 账户类型
UseFlag int `json:"useFlag"` // 使用标志
UserRole int `json:"userRole"` // 用户角色
}
FamilyInfoResp 家庭云账户信息,包含账户的基本信息和角色。
type GetUploadFileStatusResp ¶
type GetUploadFileStatusResp struct {
CreateUploadFileResp
// 已上传的大小
DataSize int64 `json:"dataSize"`
Size int64 `json:"size"`
}
GetUploadFileStatusResp 获取上传文件状态的响应
func (*GetUploadFileStatusResp) GetSize ¶
func (r *GetUploadFileStatusResp) GetSize() int64
GetSize 获取文件大小
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"`
}
上传部分
InitMultiUploadResp 初始化分片上传的响应
type LoginParam ¶
type LoginParam struct {
// 加密后的用户名和密码
RsaUsername string // 经过RSA加密的用户名
RsaPassword string // 经过RSA加密的密码
// RSA密钥
JRsaKey string `json:"jRsaKey"` // RSA公钥标识
// 请求头参数
Lt string // 登录令牌
ReqID string `json:"ReqId"` // 请求ID
// 表单参数
ParamID string `json:"ParamId"` // 参数ID
// 验证码相关
CaptchaToken string // 验证码令牌
ValidateCode string // 验证码值
}
LoginParam 存储登录所需的参数信息,包括加密后的凭据和相关令牌。
type LoginResp ¶
type LoginResp struct {
Msg string `json:"msg"` // 响应消息
Result int `json:"result"` // 结果代码,0表示成功
ToUrl string `json:"toUrl"` // 登录成功后的跳转URL
}
LoginResp 登录响应,包含登录结果和跳转URL。
type OldCommitUploadFileResp ¶
type OldCommitUploadFileResp struct {
XMLName xml.Name `xml:"file"`
ID String `xml:"id"`
Name string `xml:"name"`
Size int64 `xml:"size"`
Md5 string `xml:"md5"`
CreateDate Time `xml:"createDate"`
}
OldCommitUploadFileResp 旧版上传文件提交响应
type RespErr ¶
type RespErr struct {
ResponseCode any `json:"res_code"` // 响应代码,可能是整数或字符串
ResponseMessage string `json:"res_message"` // 响应消息,描述错误详情
ErrorDesc string `json:"error"` // 错误描述,另一种格式的错误字段
XMLName xml.Name `xml:"error"` // XML根元素名称
Code string `json:"code" xml:"code"` // 错误代码
Message string `json:"message" xml:"message"` // 错误消息
Msg string `json:"msg"` // 错误消息,另一种格式
ErrorCode string `json:"errorCode"` // 错误代码,另一种格式
ErrorMsg string `json:"errorMsg"` // 错误消息,另一种格式
}
RespErr 表示API响应中的错误信息,兼容189云盘API的多种错误返回格式。
type String ¶
type String string
String 自定义字符串类型,用于处理特殊格式的字符串解析
func (*String) UnmarshalJSON ¶
UnmarshalJSON 实现JSON反序列化接口
func (*String) UnmarshalXML ¶
UnmarshalXML 实现XML反序列化接口
type Time ¶
Time 自定义时间类型,用于处理多种格式的时间解析
func (*Time) UnmarshalJSON ¶
UnmarshalJSON 实现JSON反序列化接口
func (*Time) UnmarshalXML ¶
UnmarshalXML 实现XML反序列化接口
type UploadProgress ¶
type UploadProgress struct {
UploadInfo InitMultiUploadResp
UploadParts []string
}
UploadProgress 上传进度信息
type UploadUrlInfo ¶
type UploadUrlInfo struct {
PartNumber int
Headers map[string]string
UploadUrlsData
}
UploadUrlInfo 上传URL信息,包含分片序号和请求头
type UploadUrlsData ¶
type UploadUrlsData struct {
RequestURL string `json:"requestURL"`
RequestHeader string `json:"requestHeader"`
}
UploadUrlsData 上传URL数据
type UploadUrlsResp ¶
type UploadUrlsResp struct {
Code string `json:"code"`
Data map[string]UploadUrlsData `json:"uploadUrls"`
}
UploadUrlsResp 上传URL响应
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"` // 家庭云会话秘钥
}
UserSessionResp 刷新会话时返回的响应,包含会话密钥等信息。
type WrapFileStreamer ¶
type WrapFileStreamer struct {
model.FileStreamer
Name string
}
WrapFileStreamer 文件流包装器
func (*WrapFileStreamer) GetName ¶
func (w *WrapFileStreamer) GetName() string
GetName 获取文件名 返回值: 文件名