Help us shape the future of Go! Take the 2026 Go Developer Survey

upload

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 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 added in v1.0.1

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

func InitAliyunOSSUpload added in v1.0.1

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

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

func (*AliyunOSSUpload) DeleteObject added in v1.0.1

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

DeleteObject 删除OSS中的对象

func (*AliyunOSSUpload) GetObjectURL added in v1.0.1

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

GetObjectURL 获取对象的访问URL

func (*AliyunOSSUpload) GetPublicUrl added in v1.0.1

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

func (*AliyunOSSUpload) GetSignedURL added in v1.0.1

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

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

func (*AliyunOSSUpload) IsAvailable added in v1.0.1

func (a *AliyunOSSUpload) IsAvailable() bool

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

func (*AliyunOSSUpload) Upload added in v1.0.1

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

Upload 上传文件到阿里云OSS

func (*AliyunOSSUpload) UploadWithMetadata added in v1.0.1

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 added in v1.0.1

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

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

func (*QiniuUpload) GetPublicURL added in v1.0.1

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