resumable_upload_v2_complete_multipart_upload

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: 3 Imported by: 0

Documentation

Overview

在将所有数据分片都上传完成后,必须调用 completeMultipartUpload API 来完成整个文件的 Multipart Upload。用户需要提供有效数据的分片列表(包括 PartNumber 和调用 uploadPart API 服务端返回的 Etag)。服务端收到用户提交的分片列表后,会逐一验证每个数据分片的有效性。当所有的数据分片验证通过后,会把这些数据分片组合成一个完整的对象

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ObjectInfo

type ObjectInfo = Request

新上传的对象的相关信息

type PartInfo

type PartInfo struct {
	PartNumber int64  // 每一个上传的分片都有一个标识它的号码
	Etag       string // 上传块的 etag
}

单个分片信息

func (*PartInfo) MarshalJSON

func (j *PartInfo) MarshalJSON() ([]byte, error)

func (*PartInfo) UnmarshalJSON

func (j *PartInfo) UnmarshalJSON(data []byte) error

type Parts

type Parts = []PartInfo

分片信息列表

type Request

type Request struct {
	BucketName   string            // 存储空间名称
	ObjectName   *string           // 对象名称
	UploadId     string            // 在服务端申请的 Multipart Upload 任务 id
	UpToken      uptoken.Provider  // 上传凭证,如果为空,则使用 HTTPClientOptions 中的 UpToken
	Parts        Parts             // 已经上传的分片列表
	FileName     string            // 上传的原始文件名,若未指定,则魔法变量中无法使用 fname,ext,suffix
	MimeType     string            // 若指定了则设置上传文件的 MIME 类型,若未指定,则根据文件内容自动检测 MIME 类型
	Metadata     map[string]string // 用户自定义文件 metadata 信息的键值对,可以设置多个,MetaKey 和 MetaValue 都是 string,,其中 可以由字母、数字、下划线、减号组成,且长度小于等于 50,单个文件 MetaKey 和 MetaValue 总和大小不能超过 1024 字节,MetaKey 必须以 `x-qn-meta-` 作为前缀
	CustomVars   map[string]string // 用户自定义变量
	ResponseBody interface{}       // 响应体,如果为空,则 Response.Body 的类型由 encoding/json 库决定
}

调用 API 所用的请求

func (*Request) MarshalJSON

func (j *Request) MarshalJSON() ([]byte, error)

func (*Request) UnmarshalJSON

func (j *Request) UnmarshalJSON(data []byte) error

type Response

type Response struct {
	Body interface{}
}

获取 API 所用的响应

func (*Response) MarshalJSON

func (j *Response) MarshalJSON() ([]byte, error)

func (*Response) UnmarshalJSON

func (j *Response) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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