Documentation ¶
Overview ¶
Package uploader 上传包
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoUpload ¶
func DoUpload(uploadURL string, readedlen64 multipartreader.ReadedLen64, o *Options, checkFunc func(resp *http.Response, err error))
DoUpload 执行上传
Types ¶
type Options ¶
type Options struct { IsMultiPart bool // 是否表单上传 Client *requester.HTTPClient // http 客户端 }
Options are the options for creating a new Uploader
type UploadStatus ¶
type UploadStatus struct { Length int64 // 总大小 Uploaded int64 // 已上传数据 Speed int64 // 上传速度, 每秒 TimeElapsed time.Duration // 上传时间 }
UploadStatus 上传状态
type Uploader ¶
type Uploader struct { URL string // 上传地址 Body multipartreader.ReadedLen64 // 要上传的对象 Options *Options UploadStatus <-chan UploadStatus // 上传状态 // contains filtered or unexported fields }
Uploader 上传
func NewUploader ¶
func NewUploader(url string, readedlen64 multipartreader.ReadedLen64, o *Options) (uploader *Uploader)
NewUploader 返回 uploader 对象, url: 上传地址, readedlen64: 实现 multipartreader.ReadedLen64 接口的对象, 例如文件
Click to show internal directories.
Click to hide internal directories.