pcsupload

package
v3.5.5+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package pcsupload 上传包

Index

Constants

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 PCSUpload

type PCSUpload struct {
	// contains filtered or unexported fields
}

func (*PCSUpload) CreateSuperFile

func (pu *PCSUpload) CreateSuperFile(checksumList ...string) (err error)

func (*PCSUpload) Precreate

func (pu *PCSUpload) Precreate() (err error)

Precreate do nothing

func (*PCSUpload) TmpFile

func (pu *PCSUpload) TmpFile(ctx context.Context, partseq int, partOffset int64, r rio.ReaderLen64) (checksum string, uperr error)

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) Close

func (ud *UploadingDatabase) Close() error

Close 关闭数据库

func (*UploadingDatabase) Delete

func (ud *UploadingDatabase) Delete(meta *checksum.LocalFileMeta) bool

Delete 删除

func (*UploadingDatabase) Save

func (ud *UploadingDatabase) Save() error

Save 保存内容

func (*UploadingDatabase) Search

Search 搜索

func (*UploadingDatabase) UpdateUploading

func (ud *UploadingDatabase) UpdateUploading(meta *checksum.LocalFileMeta, state *uploader.InstanceState)

UpdateUploading 更新正在上传

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL