-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(drivers): add halalcloud_open driver #1430
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
jyxjjj
left a comment
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.
我们还不准备升级Go版本到24
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 a new HalalCloud Open driver that supports user-level ClientID/ClientSecret authentication without requiring login, provides direct file download with 302 redirects, and implements file upload functionality to fix issue #1255.
- Adds complete HalalCloudOpen driver implementation with SDK-based API integration
- Implements file operations (list, upload, download, move, copy, rename, delete) and direct link generation
- Integrates authentication using client credentials and refresh tokens with automatic token management
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| go.mod | Updates Go version and adds HalalCloud SDK dependency |
| drivers/halalcloud_open/*.go | Complete driver implementation including utilities, file operations, upload handling, and API interfaces |
| drivers/all.go | Registers the new HalalCloudOpen driver |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
我们使用了logrus,且代码中部分日志实际上为DEBUG级,并非需要直接输出为INFO。 |
Downgrade Go version from 1.24.2 to 1.23.4 Signed-off-by: zzzhr1990 <zzzhr@hotmail.com>
* Removed unnecessary comments * Downgraded the Go version to 1.23.4. * Not sure whether FileStream supports concurrent read and write operations, so currently using single-threaded upload to ensure safety. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: zzzhr1990 <zzzhr@hotmail.com>
zzzhr1990
left a comment
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.
- Not sure whether FileStream supports concurrent read and write operations, so currently using single-threaded upload to ensure safety.
- Downgraded the Go version to 1.23.4.
Not sure whether FileStream supports concurrent read and write operations, so currently using single-threaded upload to ensure safety. Signed-off-by: zzzhr1990 <zzzhr@hotmail.com>
Change required for RefreshToken, If using a personal API approach, the RefreshToken is not required. Signed-off-by: zzzhr1990 <zzzhr@hotmail.com>
zzzhr1990
left a comment
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.
change RefreshToken required to false.
|
golang 版本已经降至 1.23.4 |
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
Copilot reviewed 12 out of 13 changed files in this pull request and generated 8 comments.
Comments suppressed due to low confidence (4)
drivers/halalcloud_open/utils.go:1
- Parameter name 'preix' should be 'prefix'.
package halalcloudopen
drivers/halalcloud_open/utils.go:1
- Parameter name 'preix' should be 'prefix'.
package halalcloudopen
drivers/halalcloud_open/utils.go:1
- Variable name 'preix' should be 'prefix'.
package halalcloudopen
drivers/halalcloud_open/utils.go:1
- Variable name 'preix' should be 'prefix'.
package halalcloudopen
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
KirCute
left a comment
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.
Copilot 说的 timeout 拼写问题可以改一下,别的我这看没问题了
|
拼写错误有好几个的,都改掉 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: zzzhr1990 <zzzhr@hotmail.com>
|
|
|
其实上面都是细节问题,不改也行 |
bb4fdcb
指针的问题已经修改了,sync.Map 的那个 我还是觉得可能 sync.Map 相对于Map和锁更安全些(可能在写值的时候会忘记加锁)毕竟 sync.Map 能出的问题是类型转换失败,而这个很容易复现和排查。 |
Description / 描述
Motivation and Context / 背景
支持文件上传
Closes #1255
How Has This Been Tested? / 测试
Checklist / 检查清单
我已阅读 CONTRIBUTING 文档。
go fmtor prettier.我已使用
go fmt或 prettier 格式化提交的代码。我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
我已相应更新了相关仓库(若适用)。