Documentation ¶
Overview ¶
Package pcsupload 上传包
Index ¶
- Constants
- func NewPCSUpload(pcs *baidupcs.BaiduPCS, targetPath string) uploader.MultiUpload
- type EmptyReaderLen64
- type PCSUpload
- type StepUpload
- type UploadStatistic
- type UploadTaskUnit
- func (utu *UploadTaskUnit) OnComplete(lastRunResult *taskframework.TaskUnitRunResult)
- func (utu *UploadTaskUnit) OnFailed(lastRunResult *taskframework.TaskUnitRunResult)
- func (utu *UploadTaskUnit) OnRetry(lastRunResult *taskframework.TaskUnitRunResult)
- func (utu *UploadTaskUnit) OnSuccess(lastRunResult *taskframework.TaskUnitRunResult)
- func (utu *UploadTaskUnit) RetryWait() time.Duration
- func (utu *UploadTaskUnit) Run() (result *taskframework.TaskUnitRunResult)
- func (utu *UploadTaskUnit) SetTaskInfo(taskInfo *taskframework.TaskInfo)
- type Uploading
- type UploadingDatabase
- func (ud *UploadingDatabase) Close() error
- func (ud *UploadingDatabase) Delete(meta *checksum.LocalFileMeta) bool
- func (ud *UploadingDatabase) Save() error
- func (ud *UploadingDatabase) Search(meta *checksum.LocalFileMeta) *uploader.InstanceState
- func (ud *UploadingDatabase) UpdateUploading(meta *checksum.LocalFileMeta, state *uploader.InstanceState)
Constants ¶
View Source
const (
StrUploadFailed = "上传文件失败"
)
View Source
const (
UploadingFileName = "pcs_uploading.json"
)
Variables ¶
This section is empty.
Functions ¶
func NewPCSUpload ¶
func NewPCSUpload(pcs *baidupcs.BaiduPCS, targetPath string) uploader.MultiUpload
Types ¶
type EmptyReaderLen64 ¶
type EmptyReaderLen64 struct { }
func (EmptyReaderLen64) Len ¶
func (e EmptyReaderLen64) Len() int64
type PCSUpload ¶
type PCSUpload struct {
// contains filtered or unexported fields
}
func (*PCSUpload) CreateSuperFile ¶
type StepUpload ¶
type StepUpload int
StepUpload 上传步骤
const ( // StepUploadInit 初始化步骤 StepUploadInit StepUpload = iota // StepUploadRapidUpload 秒传步骤 StepUploadRapidUpload // StepUploadUpload 正常上传步骤 StepUploadUpload )
type UploadStatistic ¶
type UploadStatistic struct {
pcsfunctions.Statistic
}
type UploadTaskUnit ¶
type UploadTaskUnit struct { LocalFileChecksum *checksum.LocalFileChecksum // 要上传的本地文件详情 Step StepUpload SavePath string // 保存路径 PCS *baidupcs.BaiduPCS UploadingDatabase *UploadingDatabase // 数据库 Parallel int NoRapidUpload bool // 禁用秒传 NoSplitFile bool // 禁用分片上传 UploadStatistic *UploadStatistic // contains filtered or unexported fields }
UploadTaskUnit 上传的任务单元
func (*UploadTaskUnit) OnComplete ¶
func (utu *UploadTaskUnit) OnComplete(lastRunResult *taskframework.TaskUnitRunResult)
func (*UploadTaskUnit) OnFailed ¶
func (utu *UploadTaskUnit) OnFailed(lastRunResult *taskframework.TaskUnitRunResult)
func (*UploadTaskUnit) OnRetry ¶
func (utu *UploadTaskUnit) OnRetry(lastRunResult *taskframework.TaskUnitRunResult)
func (*UploadTaskUnit) OnSuccess ¶
func (utu *UploadTaskUnit) OnSuccess(lastRunResult *taskframework.TaskUnitRunResult)
func (*UploadTaskUnit) RetryWait ¶
func (utu *UploadTaskUnit) RetryWait() time.Duration
func (*UploadTaskUnit) Run ¶
func (utu *UploadTaskUnit) Run() (result *taskframework.TaskUnitRunResult)
func (*UploadTaskUnit) SetTaskInfo ¶
func (utu *UploadTaskUnit) SetTaskInfo(taskInfo *taskframework.TaskInfo)
type Uploading ¶
type Uploading struct { *checksum.LocalFileMeta State *uploader.InstanceState `json:"state"` }
Uploading 未完成上传的信息
type UploadingDatabase ¶
type UploadingDatabase struct { UploadingList []*Uploading `json:"upload_state"` Timestamp int64 `json:"timestamp"` // contains filtered or unexported fields }
UploadingDatabase 未完成上传的数据库
func NewUploadingDatabase ¶
func NewUploadingDatabase() (ud *UploadingDatabase, err error)
NewUploadingDatabase 初始化未完成上传的数据库, 从库中读取内容
func (*UploadingDatabase) Delete ¶
func (ud *UploadingDatabase) Delete(meta *checksum.LocalFileMeta) bool
Delete 删除
func (*UploadingDatabase) Search ¶
func (ud *UploadingDatabase) Search(meta *checksum.LocalFileMeta) *uploader.InstanceState
Search 搜索
func (*UploadingDatabase) UpdateUploading ¶
func (ud *UploadingDatabase) UpdateUploading(meta *checksum.LocalFileMeta, state *uploader.InstanceState)
UpdateUploading 更新正在上传
Click to show internal directories.
Click to hide internal directories.