Documentation ¶
Index ¶
- func NewProgressReader(r io.Reader, fn func(current int64)) io.Reader
- func WasmClose(uuid string) error
- func WasmOpen(uuid string) (int64, error)
- func WasmRead(uuid string, offset int64, length int64) ([]byte, error)
- type Bitmap
- type File
- type Md5Reader
- type ReadFile
- type Reader
- type UploadFileCallback
- type UploadFileReq
- type UploadFileResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) UploadFile ¶
func (f *File) UploadFile(ctx context.Context, req *UploadFileReq, cb UploadFileCallback) (*UploadFileResp, error)
type Md5Reader ¶
type Md5Reader struct {
// contains filtered or unexported fields
}
func NewMd5Reader ¶
type UploadFileCallback ¶
type UploadFileCallback interface { Open(size int64) // 文件打开的大小 PartSize(partSize int64, num int) // 分片大小,数量 HashPartProgress(index int, size int64, partHash string) // 每块分片的hash值 HashPartComplete(partsHash string, fileHash string) // 分块完成,服务端标记hash和文件最终hash UploadID(uploadID string) // 上传ID UploadPartComplete(index int, partSize int64, partHash string) // 上传分片进度 UploadComplete(fileSize int64, streamSize int64, storageSize int64) // 整体进度 Complete(size int64, url string, typ int) // 上传完成 }
type UploadFileReq ¶
type UploadFileResp ¶
type UploadFileResp struct {
URL string `json:"url"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.