upload

package
v0.0.0-...-c5f6412 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HuaWeiObs = new(Obs)

Functions

func NewBucket

func NewBucket() (*oss.Bucket, error)

func NewClient

func NewClient() *cos.Client

NewClient init COS client

func NewHuaWeiObsClient

func NewHuaWeiObsClient() (client *obs.ObsClient, err error)

Types

type AliyunOSS

type AliyunOSS struct{}

func (*AliyunOSS) DeleteFile

func (*AliyunOSS) DeleteFile(key string) error

func (*AliyunOSS) UploadFile

func (*AliyunOSS) UploadFile(file *multipart.FileHeader) (string, string, error)

type AwsS3

type AwsS3 struct{}

func (*AwsS3) DeleteFile

func (*AwsS3) DeleteFile(key string) error

func (*AwsS3) UploadFile

func (*AwsS3) UploadFile(file *multipart.FileHeader) (string, string, error)

type CloudflareR2

type CloudflareR2 struct{}

func (*CloudflareR2) DeleteFile

func (c *CloudflareR2) DeleteFile(key string) error

func (*CloudflareR2) UploadFile

func (c *CloudflareR2) UploadFile(file *multipart.FileHeader) (fileUrl string, fileName string, err error)

type Local

type Local struct{}

func (*Local) DeleteFile

func (*Local) DeleteFile(key string) error

func (*Local) UploadFile

func (*Local) UploadFile(file *multipart.FileHeader) (string, string, error)

type Minio

type Minio struct {
	Client *minio.Client
	// contains filtered or unexported fields
}
var MinioClient *Minio // 优化性能,但是不支持动态配置

func GetMinio

func GetMinio(endpoint, accessKeyID, secretAccessKey, bucketName string, useSSL bool) (*Minio, error)

func (*Minio) DeleteFile

func (m *Minio) DeleteFile(key string) error

func (*Minio) UploadFile

func (m *Minio) UploadFile(file *multipart.FileHeader) (filePathres, key string, uploadErr error)

type OSS

type OSS interface {
	UploadFile(file *multipart.FileHeader) (string, string, error)
	DeleteFile(key string) error
}

OSS 对象存储接口 Author [SliverHorn](https://github.com/SliverHorn) Author [ccfish86](https://github.com/ccfish86)

func NewOss

func NewOss() OSS

NewOss OSS的实例化方法 Author [SliverHorn](https://github.com/SliverHorn) Author [ccfish86](https://github.com/ccfish86)

type Obs

type Obs struct{}

func (*Obs) DeleteFile

func (o *Obs) DeleteFile(key string) error

func (*Obs) UploadFile

func (o *Obs) UploadFile(file *multipart.FileHeader) (string, string, error)

type Qiniu

type Qiniu struct{}

func (*Qiniu) DeleteFile

func (*Qiniu) DeleteFile(key string) error

func (*Qiniu) UploadFile

func (*Qiniu) UploadFile(file *multipart.FileHeader) (string, string, error)

type TencentCOS

type TencentCOS struct{}

func (*TencentCOS) DeleteFile

func (*TencentCOS) DeleteFile(key string) error

DeleteFile delete file form COS

func (*TencentCOS) UploadFile

func (*TencentCOS) UploadFile(file *multipart.FileHeader) (string, string, error)

UploadFile upload file to COS

Jump to

Keyboard shortcuts

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