storage

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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