uoa

package module
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: Apache-2.0 Imports: 14 Imported by: 5

README

uoa 统一对象存储接入方案

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContentType added in v1.0.1

func ContentType(contentType string) *optionContentType

ContentType 配置应用名称

func CosUrl added in v1.0.8

func CosUrl(url string) *optionEndpoint

CosUrl 配置Cos地址

func Download

func Download() *optionDownload

Download 配置应用名称

func Downstream added in v1.1.9

func Downstream() *optionStream

Downstream 配置下载

func Endpoint added in v1.0.8

func Endpoint(endpoint string) *optionEndpoint

Endpoint 配置通信端点

func Environment added in v1.0.3

func Environment(environment gox.Environment) *optionEnvironment

Environment 配置应用名称

func Expired

func Expired(expired time.Duration) *optionExpired

Expired 配置应用名称

func Filename added in v1.1.9

func Filename(filename string) *optionFilename

Filename 配置文件名

func Inline

func Inline() *optionInline

Inline 配置应用名称

func NewCredentialsOptions added in v1.1.5

func NewCredentialsOptions(opts ...credentialsOption) []credentialsOption

NewCredentialsOptions 创建选项,因为option接口不对外暴露,如果用户想在外面创建option并赋值将无法完成,特意提供创建option的快捷方式

func NewDeleteOptions added in v1.1.9

func NewDeleteOptions(opts ...deleteOption) []deleteOption

NewDeleteOptions 创建选项,因为option接口不对外暴露,如果用户想在外面创建option并赋值将无法完成,特意提供创建option的快捷方式

func NewMultipartOption added in v1.1.9

func NewMultipartOption(opts ...multipartOption) []multipartOption

NewMultipartOption 创建选项,因为option接口不对外暴露,如果用户想在外面创建option并赋值将无法完成,特意提供创建option的快捷方式

func NewUrlOptions added in v1.1.1

func NewUrlOptions(opts ...urlOption) []urlOption

NewUrlOptions 创建选项,因为option接口不对外暴露,如果用户想在外面创建option并赋值将无法完成,特意提供创建option的快捷方式

func Patterns added in v1.1.4

func Patterns(patterns ...string) *optionPatterns

Patterns 配置多文件名

func Pm3u8 added in v1.2.6

func Pm3u8() *optionPm3u8

Pm3u8 配置解析私有M3u8存储文件

func Secret added in v1.0.10

func Secret(secret gox.Secret) *optionSecret

Secret 配置授权

func Separator added in v1.0.3

func Separator(separator string) *optionSeparator

Separator 配置分隔符

func Tencentyun added in v1.0.10

func Tencentyun(secretId string, secretKey string) *optionSecret

Tencentyun 配置腾讯云授权

func Upstream added in v1.1.9

func Upstream() *optionStream

Upstream 配置上传

func Version added in v1.1.9

func Version(version string) *optionVersion

Version 配置版本

Types

type Credentials added in v1.1.5

type Credentials struct {

	// 连接地址
	Url string `json:"url" yaml:"url" xml:"url"`
	// 分隔符
	Separator string `json:"separator" yaml:"separator" xml:"separator"`
	// contains filtered or unexported fields
}

Credentials 授权

type Object added in v1.1.9

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

Object 文件数据

func NewObject added in v1.1.9

func NewObject(key string, etag string, size int64, part int32, version string) Object

NewObject 创建文件数据

type Path added in v1.1.1

type Path interface {
	// Paths 对应路径,按路径划分
	// 如果不需要目录路径,可以只返回一个数据的数组
	Paths() []string
}

Path 一个可以生成文件键的对象

type Type

type Type string

Type 对象存储类型

const (
	// TypeCos 腾讯云对象存储
	TypeCos Type = "cos"
)

type Uoa

type Uoa interface {
	// Exist 检查文件是否存在
	Exist(ctx context.Context, path Path, opts ...option) (exist bool, err error)

	// Credentials 临时密钥
	Credentials(ctx context.Context, path Path, opts ...credentialsOption) (credentials *Credentials, err error)

	// Url 地址
	Url(ctx context.Context, path Path, opts ...urlOption) (url *url.URL, err error)

	// InitiateMultipart 初始化分块上传
	InitiateMultipart(ctx context.Context, path Path, opts ...multipartOption) (uploadId string, err error)

	// CompleteMultipart 完成分块上传
	CompleteMultipart(ctx context.Context, path Path, uploadId string, objects []Object, opts ...multipartOption) (err error)

	// AbortMultipart 终止分块上传
	AbortMultipart(ctx context.Context, path Path, uploadId string, opts ...multipartOption) (err error)

	// Delete 删除
	Delete(ctx context.Context, path Path, opts ...deleteOption) (err error)
}

Uoa 对象存储接口

func New

func New(opts ...option) Uoa

New 创建适配器

Jump to

Keyboard shortcuts

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