Renaming GetObject to GetPartialObject

This commit is contained in:
Frederick F. Kautz IV
2015-06-10 19:24:44 -07:00
parent e7ec83d94a
commit 36552f4d03
8 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -28,7 +28,7 @@
},
{
"ImportPath": "github.com/minio/minio-go",
"Rev": "2313097b2debae7b284b4bedb44e2fafa6a26e12"
"Rev": "7ece99186572e9cea437333e33b862ecfcfc95c8"
},
{
"ImportPath": "github.com/minio/minio/pkg/iodine",
+1 -3
View File
@@ -38,7 +38,7 @@ func main() {
## Documentation
* [PutObject(string, string, int64, io.Reader) error](examples/s3/putobject.go)
* [GetObject(string, string, int64, int64](examples/s3/getobject.go)
* [GetObject(string, string](examples/s3/getobject.go)
* [ListObjects(string, string, bool) <-chan](examples/s3/listobjects.go)
* [ListBuckets() <-chan](examples/s3/listbuckets.go)
@@ -46,8 +46,6 @@ func main() {
[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/minio/minio-go)
* API reference [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/minio/minio-go)
## Join The Community
* Community hangout on Gitter [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/minio/minio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
* Ask questions on Quora [![Quora](http://upload.wikimedia.org/wikipedia/commons/thumb/5/57/Quora_logo.svg/55px-Quora_logo.svg.png)](http://www.quora.com/Minio)
+6 -5
View File
@@ -54,7 +54,7 @@ type BucketAPI interface {
// ObjectAPI - object specific Read/Write/Stat interface
type ObjectAPI interface {
GetObject(bucket, object string, offset, length int64) (io.ReadCloser, ObjectStat, error)
GetPartialObject(bucket, object string, offset, length int64) (io.ReadCloser, ObjectStat, error)
PutObject(bucket, object string, size int64, data io.Reader) error
StatObject(bucket, object string) (ObjectStat, error)
RemoveObject(bucket, object string) error
@@ -181,13 +181,14 @@ func New(config Config) (API, error) {
/// Object operations
// GetObject retrieve object
// GetPartialObject retrieve object
//
// Additionally it also takes range arguments to download the specified range bytes of an object.
// Takes range arguments to download the specified range bytes of an object.
// Setting offset and length = 0 will download the full object.
// For more information about the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.
func (a api) GetObject(bucket, object string, offset, length int64) (io.ReadCloser, ObjectStat, error) {
func (a api) GetPartialObject(bucket, object string, offset, length int64) (io.ReadCloser, ObjectStat, error) {
// get the the object
return a.getObject(bucket, object, offset, length)
return a.getPartialObject(bucket, object, offset, length)
}
// completedParts is a wrapper to make parts sortable by their part number
+1 -1
View File
@@ -166,7 +166,7 @@ func TestObjectOperations(t *testing.T) {
t.Fatalf("Error")
}
reader, metadata, err := a.GetObject("bucket", "object", 0, 0)
reader, metadata, err := a.GetPartialObject("bucket", "object", 0, 0)
if err != nil {
t.Fatalf("Error")
}
@@ -36,7 +36,7 @@ func main() {
if err != nil {
log.Fatalln(err)
}
reader, stat, err := playClient.GetObject("mybucket", "myobject", 0, 0)
reader, stat, err := playClient.GetPartialObject("mybucket", "myobject", 0, 0)
if err != nil {
log.Fatalln(err)
}
+1 -1
View File
@@ -36,7 +36,7 @@ func main() {
if err != nil {
log.Fatalln(err)
}
reader, stat, err := s3Client.GetObject("mybucket", "myobject", 0, 0)
reader, stat, err := s3Client.GetPartialObject("mybucket", "myobject", 0, 0)
if err != nil {
log.Fatalln(err)
}
+3 -2
View File
@@ -497,11 +497,12 @@ func (a lowLevelAPI) getObjectRequest(bucket, object string, offset, length int6
return r, nil
}
// getObject - retrieve object from Object Storage
// getPartialObject - retrieve object from Object Storage
//
// Additionally it also takes range arguments to download the specified range bytes of an object.
// Setting offset and length = 0 will download the full object.
// For more information about the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.
func (a lowLevelAPI) getObject(bucket, object string, offset, length int64) (io.ReadCloser, ObjectStat, error) {
func (a lowLevelAPI) getPartialObject(bucket, object string, offset, length int64) (io.ReadCloser, ObjectStat, error) {
if err := invalidArgumentToError(object); err != nil {
return nil, ObjectStat{}, err
}
+1 -1
View File
@@ -117,7 +117,7 @@ func (c *s3Client) URL() *client.URL {
// GetObject - get object
func (c *s3Client) GetObject(offset, length int64) (io.ReadCloser, int64, error) {
bucket, object := c.url2BucketAndObject()
reader, metadata, err := c.api.GetObject(bucket, object, offset, length)
reader, metadata, err := c.api.GetPartialObject(bucket, object, offset, length)
if err != nil {
return nil, length, iodine.New(err, nil)
}