Documentation ¶
Index ¶
- Constants
- func Start(fileFullPaths []string, userRecode string, userPassword string, ...)
- type ChangeDownCount
- type ChangeExpireTime
- type ChangePassword
- type ChangeRecode
- type ChangeRequestErrorResponse
- type ChangeRequestResponse
- type FinishRequest
- type FinishResponse
- type Instance
- type UploadFile
- type UploadPolicy
- type UploadResponse
Constants ¶
View Source
const ( UploadFileReadyCode = iota // 0 UploadFileSuccessCode // 1 UploadFileFailedCode // 2 )
上传文件对应状态
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChangeDownCount ¶
type ChangeDownCount struct { NewDownCount int `json:"new_down_count"` UserToken string `json:"user_token"` }
修改下载次数
type ChangeExpireTime ¶
type ChangeExpireTime struct { NewExpireTime int `json:"new_expire_time"` UserToken string `json:"user_token"` }
修改过期时间
type ChangePassword ¶
type ChangePassword struct { Auth string `json:"auth"` // 加密密码 UserToken string `json:"user_token"` }
修改密码
type ChangeRecode ¶
type ChangeRecode struct { Auth string `json:"auth"` // 如果设置了密码需要上传密码才可以修改提取码 NewReCode string `json:"new_re_code"` UserToken string `json:"user_token"` }
修改请求 修改提取码
type ChangeRequestErrorResponse ¶
type ChangeRequestErrorResponse struct { ErrCode int `json:"err_code"` Message string `json:"message"` }
修改返回的错误请求
type ChangeRequestResponse ¶
type ChangeRequestResponse struct {
Message string `json:"message"`
}
修改返回的请求
type FinishRequest ¶
type FinishRequest struct {
Files []string `json:"files"`
}
工具函数区 上传文件完毕发送Finish请求 example : {"files":["0f652be1-394b-43f6-95bf-948de1520d0c","5561366d-e18c-4e48-8ae9-ec46f0a70ecf"]}
type FinishResponse ¶
Finish 请求返回结果
type Instance ¶
type Instance struct { UploadPolicy UploadPolicy UploadFiles []UploadFile Owner string Recode string CSRF string // csrf token Cookie string // csrf cookie Password string // 密码 DownCount int // 下载次数 ExpireTime int // 过期时间(小时) }
上传实例 一次上传策略对应一个上传实例 一个上传实例包含多个文件上传
type UploadFile ¶
type UploadFile struct { File *os.File // 文件本体 UploadResponse *UploadResponse // 上传到OSS返回的结构体 StatusCode int // 状态码 Client *http.Client // http Client Url string // 上传地址 Values map[string]io.Reader // 上传结构体 }
上传文件
Click to show internal directories.
Click to hide internal directories.