resumablerecorder

package
v7.25.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReadableResumableRecorderMedium

type ReadableResumableRecorderMedium interface {
	io.Closer

	// 读取下一条记录
	Next(*ResumableRecord) error
}

只读的可恢复记录仪介质接口

type ResumableRecord

type ResumableRecord struct {
	// 上传对象 ID
	UploadID string

	// 上传分片 ID
	PartID string

	// 分片偏移量
	Offset uint64

	// 分片大小
	PartSize uint64

	// 分片编号
	PartNumber uint64

	// 分片过期时间
	ExpiredAt time.Time

	// 分片内容 CRC32
	CRC32 uint32

	// 分片内容 MD5
	MD5 [md5.Size]byte
}

可恢复记录

type ResumableRecorder

type ResumableRecorder interface {
	// 打开记录仪介质以读取记录
	OpenForReading(*ResumableRecorderOpenArgs) ReadableResumableRecorderMedium

	// 打开记录仪介质以追加记录
	OpenForAppending(*ResumableRecorderOpenArgs) WriteableResumableRecorderMedium

	// 新建记录仪介质以追加记录
	OpenForCreatingNew(*ResumableRecorderOpenArgs) WriteableResumableRecorderMedium

	// 删除记录仪介质
	Delete(*ResumableRecorderOpenArgs) error

	// 清理过期的记录仪介质
	ClearExpired() error
}

可恢复记录仪接口

func NewDummyResumableRecorder

func NewDummyResumableRecorder() ResumableRecorder

创建假的可恢复记录仪

func NewJsonFileSystemResumableRecorder

func NewJsonFileSystemResumableRecorder(dirPath string) ResumableRecorder

创建记录文件系统的可恢复记录仪

type ResumableRecorderOpenArgs

type ResumableRecorderOpenArgs struct {
	// AccessKey
	AccessKey string

	// 空间名称
	BucketName string

	// 对象名称
	ObjectName string

	// 数据源 ID
	SourceID string

	// 分片大小
	PartSize uint64

	// 数据源大小
	TotalSize uint64

	// 上传服务 URL
	UpEndpoints region.Endpoints
}

可恢复记录仪选项

type WriteableResumableRecorderMedium

type WriteableResumableRecorderMedium interface {
	io.Closer

	// 写入下一条记录
	Write(*ResumableRecord) error
}

只追加的可恢复记录仪介质接口

Jump to

Keyboard shortcuts

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