feat(storage): 添加阿里云OSS存储支持

- 在StorageConfig中新增AliOSS字段以配置阿里云OSS参数
- 新增AliOSSConfig结构体定义阿里云OSS相关配置项
- 在fs包中实现AliOSSAdapter适配器用于操作阿里云OSS
- 实现GetFileList方法从阿里云OSS获取并缓存文件列表
- 添加定时清理过期缓存的功能
- 更新adapter.go根据存储类型选择对应的适配器实例
This commit is contained in:
2025-12-03 15:50:09 +08:00
parent a678829f59
commit b23794587f
5 changed files with 232 additions and 20 deletions

8
go.mod
View File

@@ -1,13 +1,15 @@
module ZhenTuLocalPassiveAdapter
go 1.23.0
go 1.24.0
toolchain go1.23.6
toolchain go1.24.11
require (
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible
github.com/aws/aws-sdk-go-v2 v1.36.3
github.com/aws/aws-sdk-go-v2/credentials v1.17.62
github.com/aws/aws-sdk-go-v2/service/s3 v1.78.2
github.com/gin-gonic/gin v1.11.0
github.com/spf13/viper v1.20.0
go.opentelemetry.io/otel v1.35.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0
@@ -35,7 +37,6 @@ require (
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.8 // indirect
github.com/gin-contrib/sse v1.1.0 // indirect
github.com/gin-gonic/gin v1.11.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-playground/locales v0.14.1 // indirect
@@ -76,6 +77,7 @@ require (
golang.org/x/net v0.42.0 // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/text v0.27.0 // indirect
golang.org/x/time v0.14.0 // indirect
golang.org/x/tools v0.34.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250218202821-56aae31c358a // indirect