新增: 云OSS存储集成(七牛云+阿里云)+多桶导航+GBK编码自动转换
This commit is contained in:
60
internal/oss/types.go
Normal file
60
internal/oss/types.go
Normal file
@@ -0,0 +1,60 @@
|
||||
package oss
|
||||
|
||||
import "time"
|
||||
|
||||
// FileInfo 文件信息
|
||||
type FileInfo struct {
|
||||
Key string // 文件key
|
||||
Size int64 // 文件大小
|
||||
ETag string // 文件hash
|
||||
ContentType string // 文件类型
|
||||
LastModified time.Time // 最后修改时间
|
||||
Metadata map[string]string // 自定义元数据
|
||||
}
|
||||
|
||||
// UploadOptions 上传选项
|
||||
type UploadOptions struct {
|
||||
ContentType string // 文件类型
|
||||
Metadata map[string]string // 自定义元数据
|
||||
Callback *UploadProgressCallback // 进度回调
|
||||
}
|
||||
|
||||
// UploadProgressCallback 上传进度回调
|
||||
type UploadProgressCallback struct {
|
||||
OnProgress func(current, total int64)
|
||||
}
|
||||
|
||||
// UploadResult 上传结果
|
||||
type UploadResult struct {
|
||||
Key string // 文件key
|
||||
ETag string // 文件hash
|
||||
Size int64 // 文件大小
|
||||
}
|
||||
|
||||
// ListOptions 列举选项
|
||||
type ListOptions struct {
|
||||
Prefix string // 前缀过滤
|
||||
MaxKeys int // 最大返回数量
|
||||
Marker string // 分页标记
|
||||
Delimiter string // 分隔符(用于目录模拟)
|
||||
}
|
||||
|
||||
// ListResult 列举结果
|
||||
type ListResult struct {
|
||||
Files []FileInfo // 文件列表
|
||||
Prefixes []string // 公共前缀(模拟目录)
|
||||
IsTruncated bool // 是否还有更多数据
|
||||
NextMarker string // 下一页标记
|
||||
}
|
||||
|
||||
// BucketEntry 桶信息
|
||||
type BucketEntry struct {
|
||||
Name string // 桶名
|
||||
Region string // 区域(七牛默认 "z0",阿里云如 "oss-cn-hangzhou")
|
||||
}
|
||||
|
||||
// DeleteResult 删除结果
|
||||
type DeleteResult struct {
|
||||
Deleted []string // 成功删除的文件
|
||||
Errors []string // 失败的文件
|
||||
}
|
||||
Reference in New Issue
Block a user