upload

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliyunOSSUpload

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

func InitAliyunOSSUpload

func InitAliyunOSSUpload(accessKeyID, accessKeySecret, endpoint, bucketName string) (*AliyunOSSUpload, error)

InitAliyunOSSUpload 初始化阿里云OSS上传管理器

func (*AliyunOSSUpload) DeleteObject

func (a *AliyunOSSUpload) DeleteObject(objectKey string) error

DeleteObject 删除OSS中的对象

func (*AliyunOSSUpload) GetObjectURL

func (a *AliyunOSSUpload) GetObjectURL(objectKey string) string

GetObjectURL 获取对象的访问URL

func (*AliyunOSSUpload) GetPublicUrl

func (a *AliyunOSSUpload) GetPublicUrl(filename string) string

func (*AliyunOSSUpload) GetSignedURL

func (a *AliyunOSSUpload) GetSignedURL(objectKey string, expiredInSec int64) (string, error)

GetSignedURL 获取对象的签名URL,用于临时访问

func (*AliyunOSSUpload) IsAvailable

func (a *AliyunOSSUpload) IsAvailable() bool

IsAvailable 检查阿里云OSS服务是否可用

func (*AliyunOSSUpload) Upload

func (a *AliyunOSSUpload) Upload(ctx context.Context, reader io.Reader, name string) error

Upload 上传文件到阿里云OSS

func (*AliyunOSSUpload) UploadWithMetadata

func (a *AliyunOSSUpload) UploadWithMetadata(ctx context.Context, reader io.Reader, name string, metadata map[string]string) error

UploadWithMetadata 上传文件到阿里云OSS并附带元数据

type QiniuUpload

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

func InitQiniuUpload

func InitQiniuUpload(regionId, bucket, accessKey, secretKey string) (*QiniuUpload, error)

func (*QiniuUpload) Delete

func (q *QiniuUpload) Delete(ctx context.Context, key string) error

Delete 从七牛云存储中删除指定的文件

func (*QiniuUpload) GetPublicURL

func (q *QiniuUpload) GetPublicURL(domain string, key string) string

GetPublicURL 获取文件的公开访问URL

func (*QiniuUpload) Upload

func (q *QiniuUpload) Upload(ctx context.Context, bucket string, reader io.Reader, name string) error

Jump to

Keyboard shortcuts

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