model

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const MaxPartSize = 1024 * 1024 * 1024 * 5

MaxPartSize - maximum part size 5GiB for a single multipart upload operation.

View Source
const MinPartSize = 1024 * 1024 * 5

MinPartSize - absolute minimum part size (5 MiB) below which a part in a multipart upload may not be uploaded.

View Source
const Oss_Aliyun = "aliyun"
View Source
const Oss_Huaweiuyn = "huaweiyun"
View Source
const Oss_Minio = "minio"

Variables

View Source
var (
	ErrNilPoint = errors.New("未知参数")
)

Functions

This section is empty.

Types

type AbortMultipartUploadRequest

type AbortMultipartUploadRequest struct {

	// 文件名(包含路径)
	Key string `json:"key" form:"key" binding:"required"`
	// 分段上传任务全局唯一标识
	UploadId string `json:"uploadId" form:"uploadId" binding:"required"`
	// contains filtered or unexported fields
}

type AbortMultipartUploadResponse

type AbortMultipartUploadResponse struct {
}

type App

type App struct {
	DefaultOssType string

	AppId string
	// contains filtered or unexported fields
}

App 代表一个应用, 一个 app 中存在多种 oss 存储方式

func NewApp

func NewApp(appId string) *App

func (*App) GetInvoker

func (a *App) GetInvoker(ossType string) oss.Oss

func (*App) Register

func (a *App) Register(ossType string, eng oss.Oss)

type CompleteMultipartUploadRequest

type CompleteMultipartUploadRequest struct {

	// 文件名(包含路径)
	Key string `json:"key" form:"key" binding:"required"`
	// 分段上传任务全局唯一标识
	UploadId string `json:"uploadId" form:"uploadId" binding:"required"`
	//
	Parts []Part `json:"parts" binding:"required"`
	// contains filtered or unexported fields
}

type CompleteMultipartUploadResponse

type CompleteMultipartUploadResponse struct {
	// 资源链接
	Url string `json:"url"`
	Uri string `json:"uri"`
}

type GeneralResponse

type GeneralResponse struct {
	Result  int         `json:"result"`
	Message int         `json:"message"`
	Data    interface{} `json:"data"`
}

type GetHostReq

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

type GetHostResp

type GetHostResp struct {
	Host string `json:"host"`
}

type InitMultipartUploadRequest

type InitMultipartUploadRequest struct {

	// 文件名(包含路径)
	Key string `json:"key" form:"key" binding:"required"`
	// contains filtered or unexported fields
}

type InitMultipartUploadResponse

type InitMultipartUploadResponse struct {
	// 分段上传任务全局唯一标识
	UploadId string `json:"uploadId"`
	// 文件名(包含路径)
	Key string `json:"key"`
}

type Part

type Part struct {
	// 段数据的MD5值
	ETag string `json:"ETag" form:"ETag" binding:"required"`
	// 分段序号, 范围是1~10000
	PartNumber int32 `json:"partNumber" form:"partNumber" binding:"required"`
}

func (*Part) Convert2OssPart

func (p *Part) Convert2OssPart() oss.Part

type UploadPartRequest

type UploadPartRequest struct {

	// 文件名(包含路径)
	Key string `json:"key" form:"key" binding:"required"`
	// 分段上传任务全局唯一标识
	UploadId string `json:"uploadId" form:"uploadId" binding:"required"`
	// 分段序号, 范围是1~10000
	PartNumber int32 `json:"partNumber" form:"partNumber" binding:"required"`

	// 偏移量, 可不填
	Offset int64 `json:"-" form:"-"`

	// 分段文件大小, 可不填
	PartSize int64 `json:"-" form:"-"`

	// 文件内容
	// aliyun, huaweiyun 除了最后一段以外,其他段的大小范围是100KB~5GB;最后段大小范围是0~5GB。
	// minio 除了最后一段以外,其他段的大小范围是5MB~5GB;最后段大小范围是0~5GB。
	Body io.Reader `json:"-" form:"-"`
	// contains filtered or unexported fields
}

type UploadPartResponse

type UploadPartResponse struct {
	// 分段上传任务全局唯一标识
	UploadId string `json:"uploadId"`
	// 文件名(包含路径)
	Key string `json:"key"`
	Part
}

type UploadRequest

type UploadRequest struct {

	// 文件名(包含路径)
	Key string `json:"key" form:"key" binding:"required"`

	// 文件内容
	Body io.Reader `json:"-" form:"-"`
	Size int64     `json:"-" from:"-"`
	// contains filtered or unexported fields
}

type UploadResponse

type UploadResponse struct {
	// 资源链接
	Url string `json:"url"`
	Uri string `json:"uri"`
}

Jump to

Keyboard shortcuts

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