uoa

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: Apache-2.0 Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download() *optionDownload

Download 配置应用名称

func Expired

func Expired(expired time.Duration) *optionExpired

Expired 配置应用名称

func Inline

func Inline() *optionInline

Inline 配置应用名称

Types

type Config

type Config struct {
	// 类型
	Type Type `json:"type" yaml:"type" validate:"required,oneof=cos"`
	// 腾讯云对象存储
	Cos cosConfig `json:"tencentyun" yaml:"tencentyun" validate:"structonly"`
}

Config 配置

type Cos

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

Cos 腾讯云存储

func NewCos

func NewCos(secret gox.Secret, url *cos.BaseURL) *Cos

NewCos 创建腾讯云对象存储实现类

func (*Cos) DownloadUrl

func (c *Cos) DownloadUrl(ctx context.Context, key string, filename string, opts ...option) (downloadUrl string, err error)

func (*Cos) UploadUrl

func (c *Cos) UploadUrl(ctx context.Context, key string, opts ...option) (uploadUrl string, err error)

type Type

type Type string

Type 对象存储类型

const (
	// TypeCos 腾讯云直播
	TypeCos Type = "cos"
)

type Uoa

type Uoa interface {
	// UploadUrl 上传地址
	UploadUrl(ctx context.Context, key string, opts ...option) (uploadUrl string, err error)
	// DownloadUrl 下载地址
	DownloadUrl(ctx context.Context, key string, filename string, opts ...option) (url string, err error)
}

Uoa 对象存储接口

func New

func New(config Config) (uoa Uoa, err error)

Jump to

Keyboard shortcuts

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