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

perf: hide GetObjectResumableUploadOffset interface #220

Merged
merged 1 commit into from
Jan 25, 2024
Merged
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
7 changes: 3 additions & 4 deletions client/api_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ type IObjectClient interface {
ComputeHashRoots(reader io.Reader, isSerial bool) ([][]byte, int64, storageTypes.RedundancyType, error)
CreateFolder(ctx context.Context, bucketName, objectName string, opts types.CreateObjectOptions) (string, error)
GetObjectUploadProgress(ctx context.Context, bucketName, objectName string) (string, error)
GetObjectResumableUploadOffset(ctx context.Context, bucketName, objectName string) (uint64, error)
ListObjectsByObjectID(ctx context.Context, objectIds []uint64, opts types.EndPointOptions) (types.ListObjectsByObjectIDResponse, error)
ListObjectPolicies(ctx context.Context, objectName, bucketName string, actionType uint32, opts types.ListObjectPoliciesOptions) (types.ListObjectPoliciesResponse, error)
}
Expand Down Expand Up @@ -319,7 +318,7 @@ func (c *Client) putObjectResumable(ctx context.Context, bucketName, objectName
return err
}

offset, err := c.GetObjectResumableUploadOffset(ctx, bucketName, objectName)
offset, err := c.getObjectResumableUploadOffset(ctx, bucketName, objectName)
if err != nil {
return err
}
Expand Down Expand Up @@ -1069,8 +1068,8 @@ func (c *Client) GetObjectUploadProgress(ctx context.Context, bucketName, object
return status.ObjectInfo.ObjectStatus.String(), nil
}

// GetObjectResumableUploadOffset return the status of object including the uploading progress
func (c *Client) GetObjectResumableUploadOffset(ctx context.Context, bucketName, objectName string) (uint64, error) {
// getObjectResumableUploadOffset return the status of object including the uploading progress
func (c *Client) getObjectResumableUploadOffset(ctx context.Context, bucketName, objectName string) (uint64, error) {
status, err := c.HeadObject(ctx, bucketName, objectName)
if err != nil {
return 0, err
Expand Down
3 changes: 0 additions & 3 deletions e2e/e2e_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,6 @@ func (s *StorageTestSuite) Test_Resumable_Upload_And_Download() {
bytes.NewReader(buffer.Bytes()), types.PutObjectOptions{PartSize: partSize16MB})
s.Require().ErrorContains(err, "UploadErrorHooker")
client.UploadSegmentHooker = client.DefaultUploadSegment
offset, err := s.Client.GetObjectResumableUploadOffset(s.ClientContext, bucketName, objectName)
s.Require().NoError(err)
s.Require().Equal(offset, partSize16MB)

err = s.Client.PutObject(s.ClientContext, bucketName, objectName, int64(buffer.Len()),
bytes.NewReader(buffer.Bytes()), types.PutObjectOptions{PartSize: partSize16MB})
Expand Down
Loading