-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(123_open): update upload api v2 #976
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 updates the 123 Open cloud storage driver to use the V2 upload API, implementing MD5-based instant upload functionality for copy operations. The changes modernize the upload process by moving from V1 to V2 endpoints and introducing multipart form uploads with MD5 verification.
- Updated API endpoints from V1 to V2 for upload operations
- Replaced URL-based chunk upload with multipart form data upload including MD5 verification
- Added copy functionality using upload + MD5 instant upload feature
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| drivers/123_open/util.go | Updated API endpoints to V2 and removed unused V1 endpoints |
| drivers/123_open/upload.go | Refactored upload logic to use multipart forms with MD5 and moved completion logic |
| drivers/123_open/types.go | Updated response structures for V2 API and removed obsolete types |
| drivers/123_open/driver.go | Added copy functionality and enhanced Put method with proper completion polling |
Comments suppressed due to low confidence (1)
5b8ecb7 to
2f56c9b
Compare
|
试了下,传了个3GB的文件,没有问题,分片大小为 "sliceSize": 67108864, |
| if err != nil { | ||
| return err | ||
| } | ||
| _, err = utils.CopyWithBuffer(fw, rateLimitedRd) |
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.
为什么要用v2?v2支有表单吗?
使用表单即使是*os.File也需要读取到内存
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.
V2 只有表单
用 io.Pipe 优化一下内存占用?
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.
Uh oh!
There was an error while loading. Please reload this page.