Skip to content
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

修复bos sdk中SimpleFetchObject方法内结构体赋值未指定字段名问题,并补充fetchCallBackAddress参数 #95

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions services/bos/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1108,12 +1108,19 @@ func (c *Client) BasicFetchObject(bucket, object, source string) (*api.FetchObje
// - source: fetch source url
// - mode: fetch mode which supports sync and async
// - storageClass: the storage class of the fetched object
// - fetchCallBackAddress: the callback address of the fetched object
// RETURNS:
// - *api.FetchObjectResult: result struct with Code, Message, RequestId and JobId fields
// - error: any error if it occurs
func (c *Client) SimpleFetchObject(bucket, object, source, mode,
storageClass string) (*api.FetchObjectResult, error) {
args := &api.FetchObjectArgs{mode, storageClass}
storageClass, fetchCallBackAddress string) (*api.FetchObjectResult, error) {

args := &api.FetchObjectArgs{
FetchMode: mode,
StorageClass: storageClass,
FetchCallBackAddress: fetchCallBackAddress,
}

return api.FetchObject(c, bucket, object, source, args, c.BosContext)
}

Expand Down
2 changes: 1 addition & 1 deletion services/bos/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ func TestBasicFetchObject(t *testing.T) {
func TestSimpleFetchObject(t *testing.T) {
res, err := BOS_CLIENT.SimpleFetchObject(EXISTS_BUCKET, "test-fetch-object",
"https://bj.bcebos.com/gosdk-unittest-bucket/testsumlink",
api.FETCH_MODE_ASYNC, api.STORAGE_CLASS_COLD)
api.FETCH_MODE_ASYNC, api.STORAGE_CLASS_COLD, "")
ExpectEqual(t.Errorf, err, nil)
t.Logf("result: %+v", res)
}
Expand Down