Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProgressRecorder ¶
type ProgressRecorder struct { BlkCtxs []storage.BlkputRet `json:"blk_ctxs"` // resume v1 Parts []storage.UploadPartInfo `json:"parts"` // resume v2 UploadId string `json:"upload_id"` // resume v2 ExpireTime int64 `json:"expire_time"` // resume v2 Offset int64 `json:"offset"` TotalSize int64 `json:"total_size"` LastModified int `json:"last_modified"` // 上传文件的modification time FilePath string `json:"-"` // 断点续传记录保存文件 }
func NewProgressRecorder ¶
func NewProgressRecorder(filePath string) *ProgressRecorder
func (*ProgressRecorder) CheckValid ¶
func (p *ProgressRecorder) CheckValid(fileSize int64, lastModified int, isResumableV2 bool)
func (*ProgressRecorder) RecordProgress ¶
func (p *ProgressRecorder) RecordProgress() (err *data.CodeError)
func (*ProgressRecorder) Recover ¶
func (p *ProgressRecorder) Recover() (err *data.CodeError)
func (*ProgressRecorder) Reset ¶
func (p *ProgressRecorder) Reset()
type Resume ¶
type Resume interface { InitServer(ctx context.Context) *data.CodeError UploadBlock(ctx context.Context, index int, data []byte) *data.CodeError Complete(ctx context.Context, ret interface{}) (err *data.CodeError) }
func NewResume ¶
func NewResume(info ResumeInfo, isResumeV2 bool) Resume
type ResumeInfo ¶
Click to show internal directories.
Click to hide internal directories.