mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-11-25 03:15:19 +08:00
* 新增清真云Open驱动,支持最新的轻量SDK * Change Go version in go.mod Downgrade Go version from 1.24.2 to 1.23.4 Signed-off-by: zzzhr1990 <zzzhr@hotmail.com> * Apply suggestions from code review * 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> * feat(halalcloud_open): support disk usage * Set useSingleUpload to true for upload safety 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> * Update meta.go Change required for RefreshToken, If using a personal API approach, the RefreshToken is not required. Signed-off-by: zzzhr1990 <zzzhr@hotmail.com> * remove debug logs * bump halalcloud SDK version * fix unnecessary params * Update drivers/halalcloud_open/driver_init.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: zzzhr1990 <zzzhr@hotmail.com> * Fixed spelling errors; changed hardcoded retry parameters to constants. * remove pointer in get link function in utils.go --------- Signed-off-by: zzzhr1990 <zzzhr@hotmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: KirCute <951206789@qq.com>
30 lines
791 B
Go
30 lines
791 B
Go
package halalcloudopen
|
|
|
|
import (
|
|
"github.com/OpenListTeam/OpenList/v4/internal/driver"
|
|
"github.com/OpenListTeam/OpenList/v4/internal/model"
|
|
sdkClient "github.com/halalcloud/golang-sdk-lite/halalcloud/apiclient"
|
|
sdkUser "github.com/halalcloud/golang-sdk-lite/halalcloud/services/user"
|
|
sdkUserFile "github.com/halalcloud/golang-sdk-lite/halalcloud/services/userfile"
|
|
)
|
|
|
|
type HalalCloudOpen struct {
|
|
*halalCommon
|
|
model.Storage
|
|
Addition
|
|
sdkClient *sdkClient.Client
|
|
sdkUserFileService *sdkUserFile.UserFileService
|
|
sdkUserService *sdkUser.UserService
|
|
uploadThread int
|
|
}
|
|
|
|
func (d *HalalCloudOpen) Config() driver.Config {
|
|
return config
|
|
}
|
|
|
|
func (d *HalalCloudOpen) GetAddition() driver.Additional {
|
|
return &d.Addition
|
|
}
|
|
|
|
var _ driver.Driver = (*HalalCloudOpen)(nil)
|