file_store

package
v0.0.0-...-d3539a1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ALiYunOSS

type ALiYunOSS struct {
	Client     interface{}
	BucketName string
}

func (*ALiYunOSS) GetTempToken

func (e *ALiYunOSS) GetTempToken() (string, error)

func (*ALiYunOSS) Setup

func (e *ALiYunOSS) Setup(endpoint, accessKeyID, accessKeySecret, BucketName string, options ...ClientOption) error

Setup 装载 endpoint sss

func (*ALiYunOSS) UpLoad

func (e *ALiYunOSS) UpLoad(yourObjectName string, localFile interface{}) error

UpLoad 文件上传

type ClientOption

type ClientOption map[string]interface{}

type DriverType

type DriverType string

DriverType 驱动类型

const (
	// HuaweiOBS 华为云OBS
	HuaweiOBS DriverType = "HuaweiOBS"
	// AliYunOSS 阿里云OSS
	AliYunOSS DriverType = "AliYunOSS"
	// QiNiuKodo 七牛云kodo
	QiNiuKodo DriverType = "QiNiuKodo"
)

type FileStoreType

type FileStoreType interface {
	// Setup 装载 endpoint sss
	Setup(endpoint, accessKeyID, accessKeySecret, BucketName string, options ...ClientOption) error
	// UpLoad 上传
	UpLoad(yourObjectName string, localFile interface{}) error
	// GetTempToken 获取临时Token
	GetTempToken() (string, error)
}

FileStoreType OXS

type HuaWeiOBS

type HuaWeiOBS struct {
	Client     interface{}
	BucketName string
}

func (*HuaWeiOBS) GetTempToken

func (e *HuaWeiOBS) GetTempToken() (string, error)

func (*HuaWeiOBS) Setup

func (e *HuaWeiOBS) Setup(endpoint, accessKeyID, accessKeySecret, BucketName string, options ...ClientOption) error

func (*HuaWeiOBS) UpLoad

func (e *HuaWeiOBS) UpLoad(yourObjectName string, localFile interface{}) error

UpLoad 文件上传 yourObjectName 文件路径名称,与objectKey是同一概念,表示断点续传上传文件到OSS时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg

type OXS

type OXS struct {
	// Endpoint 访问域名
	Endpoint string
	// AccessKeyID AK
	AccessKeyID string
	// AccessKeySecret AKS
	AccessKeySecret string
	// BucketName 桶名称
	BucketName string
}

func (*OXS) Setup

func (e *OXS) Setup(driver DriverType, options ...ClientOption) FileStoreType

Setup 配置文件存储driver

type QiNiuKODO

type QiNiuKODO struct {
	Client     interface{}
	BucketName string
	// contains filtered or unexported fields
}

func (*QiNiuKODO) GetTempToken

func (e *QiNiuKODO) GetTempToken() (string, error)

func (*QiNiuKODO) Setup

func (e *QiNiuKODO) Setup(endpoint, accessKeyID, accessKeySecret, BucketName string, options ...ClientOption) error

Setup 装载 endpoint sss

func (*QiNiuKODO) UpLoad

func (e *QiNiuKODO) UpLoad(yourObjectName string, localFile interface{}) error

UpLoad 文件上传

type Zone

type Zone string
const (
	// HuaDong 华东
	HuaDong Zone = "HuaDong"
	// HuaBei 华北
	HuaBei Zone = "HuaBei"
	// HuaNan 华南
	HuaNan Zone = "HuaNan"
	// BeiMei 北美
	BeiMei Zone = "BeiMei"
	// XinJiaPo 新加坡
	XinJiaPo Zone = "XinJiaPo"
)

Jump to

Keyboard shortcuts

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