Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

feat: Initial Implementation of Storager #3

Closed
wants to merge 1 commit into from

Conversation

abyss-w
Copy link
Collaborator

@abyss-w abyss-w commented Aug 31, 2021

feat: Initial Implementation of Storager

@abyss-w
Copy link
Collaborator Author

abyss-w commented Aug 31, 2021

UCloud US3's Go SDK has some differences from other object storages, so some APIs may not be handled correctly.

BucketHost: "api.ucloud.cn",
}

srv.service, err = us3.NewFileRequest(config, nil)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be NewFileRequest. Although they share the same model, us3 requires NewBucketRequest not to call file-related APIs. Like the US3 comments says.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should separate the creation of servicer and storager, I don't think they can share a client.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be NewFileRequest. Although they share the same model, us3 requires NewBucketRequest not to call file-related APIs.

Servicer is the container for storage. It is used to manage the bucket here in my view and just as NewBucketRequest for bucket related options.

"time"

uerr "github.com/ucloud/ucloud-sdk-go/ucloud/error"
us3 "github.com/ufilesdk-dev/ufile-gosdk"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ops, so confusing name of ufile here. Strange sdk.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The predecessor of us3 is ufile.

}

store = &Storage{
client: s.service,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BucketName should be specified for NewFileRequest, ref: https://github.com/ufilesdk-dev/ufile-gosdk/blob/master/request.go#L48-L49.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//Request 创建后的 instance 不是线程安全的,如果你需要做并发的操作,请创建多个 UFileRequest。

It sound like we need to store a http.Client here and create UFileRequest every time we sending API.

@Xuanwo
Copy link
Contributor

Xuanwo commented Sep 1, 2021

As described in #4 , we will stop the development on us3 for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants