feat(config): 添加文件列表缓存配置并优化阿里云和S3适配器缓存实现

- 添加 CacheConfig 结构体定义文件列表缓存的TTL和最大条目数
- 在RecordConfig中集成Cache配置项
- 为AliOSS和S3适配器实现统一的文件列表缓存机制
- 移除原有的sync.Map缓存实现和定时清理逻辑
- 引入go-cache依赖库实现专业的缓存管理功能
- 使用LRU算法控制缓存大小避免内存泄漏
- 通过singleflight实现缓存穿透保护和并发控制
- 更新配置文件添加缓存相关配置项
- 在.gitignore中添加.exe文件忽略规则
This commit is contained in:
2025-12-29 11:17:18 +08:00
parent 86f0182593
commit 686401162f
8 changed files with 347 additions and 272 deletions

2
go.sum
View File

@@ -89,6 +89,8 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OH
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=