From 36552f4d030a48291e77d0d94d987f43547807d8 Mon Sep 17 00:00:00 2001 From: "Frederick F. Kautz IV" Date: Wed, 10 Jun 2015 19:24:44 -0700 Subject: [PATCH] Renaming GetObject to GetPartialObject --- Godeps/Godeps.json | 2 +- .../src/github.com/minio/minio-go/README.md | 4 +--- .../_workspace/src/github.com/minio/minio-go/api.go | 11 ++++++----- .../src/github.com/minio/minio-go/api_test.go | 2 +- .../minio/minio-go/examples/play/getobject.go | 2 +- .../minio/minio-go/examples/s3/getobject.go | 2 +- .../src/github.com/minio/minio-go/lowlevelapi.go | 5 +++-- pkg/client/s3/s3.go | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index f923fd2c..cc88c49e 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -28,7 +28,7 @@ }, { "ImportPath": "github.com/minio/minio-go", - "Rev": "2313097b2debae7b284b4bedb44e2fafa6a26e12" + "Rev": "7ece99186572e9cea437333e33b862ecfcfc95c8" }, { "ImportPath": "github.com/minio/minio/pkg/iodine", diff --git a/Godeps/_workspace/src/github.com/minio/minio-go/README.md b/Godeps/_workspace/src/github.com/minio/minio-go/README.md index 8ad02713..02c26cea 100644 --- a/Godeps/_workspace/src/github.com/minio/minio-go/README.md +++ b/Godeps/_workspace/src/github.com/minio/minio-go/README.md @@ -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) diff --git a/Godeps/_workspace/src/github.com/minio/minio-go/api.go b/Godeps/_workspace/src/github.com/minio/minio-go/api.go index eda2899a..3b5c42f2 100644 --- a/Godeps/_workspace/src/github.com/minio/minio-go/api.go +++ b/Godeps/_workspace/src/github.com/minio/minio-go/api.go @@ -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 diff --git a/Godeps/_workspace/src/github.com/minio/minio-go/api_test.go b/Godeps/_workspace/src/github.com/minio/minio-go/api_test.go index 905678c9..f5d33995 100644 --- a/Godeps/_workspace/src/github.com/minio/minio-go/api_test.go +++ b/Godeps/_workspace/src/github.com/minio/minio-go/api_test.go @@ -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") } diff --git a/Godeps/_workspace/src/github.com/minio/minio-go/examples/play/getobject.go b/Godeps/_workspace/src/github.com/minio/minio-go/examples/play/getobject.go index aa34e092..f81b3744 100644 --- a/Godeps/_workspace/src/github.com/minio/minio-go/examples/play/getobject.go +++ b/Godeps/_workspace/src/github.com/minio/minio-go/examples/play/getobject.go @@ -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) } diff --git a/Godeps/_workspace/src/github.com/minio/minio-go/examples/s3/getobject.go b/Godeps/_workspace/src/github.com/minio/minio-go/examples/s3/getobject.go index 0d0a4832..178c4051 100644 --- a/Godeps/_workspace/src/github.com/minio/minio-go/examples/s3/getobject.go +++ b/Godeps/_workspace/src/github.com/minio/minio-go/examples/s3/getobject.go @@ -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) } diff --git a/Godeps/_workspace/src/github.com/minio/minio-go/lowlevelapi.go b/Godeps/_workspace/src/github.com/minio/minio-go/lowlevelapi.go index 363d7eb1..dd9e8c79 100644 --- a/Godeps/_workspace/src/github.com/minio/minio-go/lowlevelapi.go +++ b/Godeps/_workspace/src/github.com/minio/minio-go/lowlevelapi.go @@ -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 } diff --git a/pkg/client/s3/s3.go b/pkg/client/s3/s3.go index 38f0ad77..8e4bc6eb 100644 --- a/pkg/client/s3/s3.go +++ b/pkg/client/s3/s3.go @@ -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) }