storage

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type S3Storage

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

S3Storage S3 存储服务实现(基于 MinIO)

func NewS3Storage

func NewS3Storage(client *minio.Client) *S3Storage

NewS3Storage 创建 S3 存储服务

func (*S3Storage) DeleteFile

func (s *S3Storage) DeleteFile(ctx context.Context, bucket string, fileKey string) error

DeleteFile 删除文件

func (*S3Storage) GenerateDownloadURL

func (s *S3Storage) GenerateDownloadURL(ctx context.Context, bucket string, fileKey string, expireSeconds int) (string, error)

GenerateDownloadURL 生成预签名下载 URL

func (*S3Storage) GenerateUploadURL

func (s *S3Storage) GenerateUploadURL(ctx context.Context, bucket string, prefix string, fileName string, expireSeconds int) (string, string, error)

GenerateUploadURL 生成预签名上传 URL

func (*S3Storage) GetFile

func (s *S3Storage) GetFile(ctx context.Context, bucket string, fileKey string) ([]byte, error)

GetFile 获取文件内容 NOTE: 用于 Excel 导入等场景,直接下载文件到内存

Jump to

Keyboard shortcuts

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