Skip to content

Commit

Permalink
add for oss
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwanthgoli committed Oct 8, 2024
1 parent 9b20509 commit a07aac6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions providers/oss/oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"testing"
"time"

"github.com/aliyun/aliyun-oss-go-sdk/oss"
alioss "github.com/aliyun/aliyun-oss-go-sdk/oss"
"github.com/go-kit/log"
"github.com/pkg/errors"
Expand Down Expand Up @@ -342,12 +343,17 @@ func (b *Bucket) getRange(_ context.Context, name string, off, length int64) (io
opts = append(opts, opt)
}

resp, err := b.bucket.GetObject(name, opts...)
resp, err := b.bucket.DoGetObject(&oss.GetObjectRequest{ObjectKey: name}, opts)
if err != nil {
return nil, err
}

return resp, nil
size, err := clientutil.ParseContentLength(resp.Response.Headers)
if err == nil {
return objstore.ObjectSizerReadCloser{ReadCloser: resp.Response, Size: size}, nil
}

return resp.Response, nil
}

// Get returns a reader for the given object name.
Expand Down

0 comments on commit a07aac6

Please sign in to comment.