-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(s3): support frontend direct upload #1631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for S3 frontend direct upload functionality and fixes the remaining space display issue for quark_uc driver. The implementation refactors timeout handling across multiple files by replacing sync.WaitGroup with channel-based timeout mechanisms.
Key Changes
- Implements S3 direct upload feature with configurable host support and presigned URL generation
- Fixes quark_uc remaining space calculation using the new
DiskUsageFromUsedAndTotalutility function - Refactors timeout handling in storage detail retrieval using channels instead of WaitGroups for better timeout control
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| server/handles/storage.go | Refactored storage response generation to use channel-based timeout mechanism instead of WaitGroup |
| internal/op/storage.go | Updated storage details retrieval with goroutine-based timeout using channels |
| drivers/s3/util.go | Added client type constants and extended getClient to support direct upload host configuration |
| drivers/s3/meta.go | Added configuration fields for enabling direct upload and specifying direct upload host |
| drivers/s3/driver.go | Implemented GetDirectUploadTools and GetDirectUploadInfo methods for S3 direct upload support |
| drivers/quark_uc/driver.go | Fixed remaining space calculation using DiskUsageFromUsedAndTotal utility |
| drivers/onedrive/meta.go | Formatting adjustment for field alignment |
| drivers/alias/util.go | Refactored listRoot timeout handling to use channel-based mechanism |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description / 描述
s3前端上传,没实现分片上传quark_uc剩余空间显示问题Motivation and Context / 背景
Closes #1629
Closes #1421
How Has This Been Tested? / 测试
没测自定义 Host,但应该没问题
Checklist / 检查清单
我已阅读 CONTRIBUTING 文档。
go fmtor prettier.我已使用
go fmt或 prettier 格式化提交的代码。我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
我已相应更新了相关仓库(若适用)。