From 703addae621a02f2defd4f631f6c77ada1dfe124 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 12 Aug 2015 01:08:28 -0700 Subject: [PATCH] update minio-go to latest release 0.2.1 --- Godeps/Godeps.json | 6 ++-- .../dustin/go-humanize/README.markdown | 3 ++ .../github.com/dustin/go-humanize/bigbytes.go | 2 +- .../dustin/go-humanize/bigbytes_test.go | 4 +-- .../github.com/dustin/go-humanize/bytes.go | 2 +- .../dustin/go-humanize/bytes_test.go | 6 ++-- .../github.com/dustin/go-humanize/comma.go | 2 +- .../src/github.com/minio/minio-go/README.md | 2 +- .../src/github.com/minio/minio-go/api-v2.go | 30 +++++++++++-------- .../examples/play/dropincompleteuploads.go | 2 +- .../examples/s3/dropincompleteuploads.go | 2 +- 11 files changed, 35 insertions(+), 26 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 98d8b4d6..d0a5db12 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -7,7 +7,7 @@ "Deps": [ { "ImportPath": "github.com/dustin/go-humanize", - "Rev": "00897f070f09f194c26d65afae734ba4c32404e8" + "Rev": "1c212aae1d02984808182b98b0da7a3e07e4c770" }, { "ImportPath": "github.com/fatih/color", @@ -29,8 +29,8 @@ }, { "ImportPath": "github.com/minio/minio-go", - "Comment": "v0.2.0-27-gd053903", - "Rev": "d053903f65055551c9327c3acf3b64b5f013cf9b" + "Comment": "v0.2.1-4-g69b0564", + "Rev": "69b05646606fd39171e16d6bf4edc84bb77787e0" }, { "ImportPath": "github.com/minio/minio/pkg/probe", diff --git a/Godeps/_workspace/src/github.com/dustin/go-humanize/README.markdown b/Godeps/_workspace/src/github.com/dustin/go-humanize/README.markdown index 079bc89a..f94e8154 100644 --- a/Godeps/_workspace/src/github.com/dustin/go-humanize/README.markdown +++ b/Godeps/_workspace/src/github.com/dustin/go-humanize/README.markdown @@ -5,6 +5,9 @@ Just a few functions for helping humanize times and sizes. `go get` it as `github.com/dustin/go-humanize`, import it as `"github.com/dustin/go-humanize"`, use it as `humanize` +See [godoc](https://godoc.org/github.com/dustin/go-humanize) for +complete documentation. + ## Sizes This lets you take numbers like `82854982` and convert them to useful diff --git a/Godeps/_workspace/src/github.com/dustin/go-humanize/bigbytes.go b/Godeps/_workspace/src/github.com/dustin/go-humanize/bigbytes.go index 6876e92e..e4a814a9 100644 --- a/Godeps/_workspace/src/github.com/dustin/go-humanize/bigbytes.go +++ b/Godeps/_workspace/src/github.com/dustin/go-humanize/bigbytes.go @@ -115,7 +115,7 @@ func humanateBigBytes(s, base *big.Int, sizes []string) string { // // BigBytes(82854982) -> 83MB func BigBytes(s *big.Int) string { - sizes := []string{"B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"} + sizes := []string{"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"} return humanateBigBytes(s, bigSIExp, sizes) } diff --git a/Godeps/_workspace/src/github.com/dustin/go-humanize/bigbytes_test.go b/Godeps/_workspace/src/github.com/dustin/go-humanize/bigbytes_test.go index a0f977a6..da367d41 100644 --- a/Godeps/_workspace/src/github.com/dustin/go-humanize/bigbytes_test.go +++ b/Godeps/_workspace/src/github.com/dustin/go-humanize/bigbytes_test.go @@ -86,8 +86,8 @@ func TestBigBytes(t *testing.T) { {"bytes(803)", bbyte(803), "803B"}, {"bytes(999)", bbyte(999), "999B"}, - {"bytes(1024)", bbyte(1024), "1.0KB"}, - {"bytes(1MB - 1)", bbyte(MByte - Byte), "1000KB"}, + {"bytes(1024)", bbyte(1024), "1.0kB"}, + {"bytes(1MB - 1)", bbyte(MByte - Byte), "1000kB"}, {"bytes(1MB)", bbyte(1024 * 1024), "1.0MB"}, {"bytes(1GB - 1K)", bbyte(GByte - KByte), "1000MB"}, diff --git a/Godeps/_workspace/src/github.com/dustin/go-humanize/bytes.go b/Godeps/_workspace/src/github.com/dustin/go-humanize/bytes.go index 4c4b5af1..b7a77b52 100644 --- a/Godeps/_workspace/src/github.com/dustin/go-humanize/bytes.go +++ b/Godeps/_workspace/src/github.com/dustin/go-humanize/bytes.go @@ -86,7 +86,7 @@ func humanateBytes(s uint64, base float64, sizes []string) string { // // Bytes(82854982) -> 83MB func Bytes(s uint64) string { - sizes := []string{"B", "KB", "MB", "GB", "TB", "PB", "EB"} + sizes := []string{"B", "kB", "MB", "GB", "TB", "PB", "EB"} return humanateBytes(s, 1000, sizes) } diff --git a/Godeps/_workspace/src/github.com/dustin/go-humanize/bytes_test.go b/Godeps/_workspace/src/github.com/dustin/go-humanize/bytes_test.go index 76a594c1..7497fa00 100644 --- a/Godeps/_workspace/src/github.com/dustin/go-humanize/bytes_test.go +++ b/Godeps/_workspace/src/github.com/dustin/go-humanize/bytes_test.go @@ -80,9 +80,9 @@ func TestBytes(t *testing.T) { {"bytes(803)", Bytes(803), "803B"}, {"bytes(999)", Bytes(999), "999B"}, - {"bytes(1024)", Bytes(1024), "1.0KB"}, - {"bytes(9999)", Bytes(9999), "10KB"}, - {"bytes(1MB - 1)", Bytes(MByte - Byte), "1000KB"}, + {"bytes(1024)", Bytes(1024), "1.0kB"}, + {"bytes(9999)", Bytes(9999), "10kB"}, + {"bytes(1MB - 1)", Bytes(MByte - Byte), "1000kB"}, {"bytes(1MB)", Bytes(1024 * 1024), "1.0MB"}, {"bytes(1GB - 1K)", Bytes(GByte - KByte), "1000MB"}, diff --git a/Godeps/_workspace/src/github.com/dustin/go-humanize/comma.go b/Godeps/_workspace/src/github.com/dustin/go-humanize/comma.go index 9d0d2ed1..20711c15 100644 --- a/Godeps/_workspace/src/github.com/dustin/go-humanize/comma.go +++ b/Godeps/_workspace/src/github.com/dustin/go-humanize/comma.go @@ -18,7 +18,7 @@ func Comma(v int64) string { v = 0 - v } - parts := []string{"", "", "", "", "", "", "", ""} + parts := []string{"", "", "", "", "", "", ""} j := len(parts) - 1 for v > 999 { 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 8cfd082e..c26d882a 100644 --- a/Godeps/_workspace/src/github.com/minio/minio-go/README.md +++ b/Godeps/_workspace/src/github.com/minio/minio-go/README.md @@ -46,7 +46,7 @@ func main() { * [ListObjects(bucket, prefix, recursive) <-chan ObjectStat](examples/s3/listobjects.go) * [ListBuckets() <-chan BucketStat](examples/s3/listbuckets.go) * [DropAllIncompleteUploads(bucket) <-chan error](examples/s3/dropallincompleteuploads.go) -* [DropIncompleteUploads(bucket, object) <-chan error](examples/s3/dropincompleteuploads.go) +* [DropIncompleteUpload(bucket, object) <-chan error](examples/s3/dropincompleteuploads.go) ### Object Level * [PutObject(bucket, object, size, io.Reader) error](examples/s3/putobject.go) diff --git a/Godeps/_workspace/src/github.com/minio/minio-go/api-v2.go b/Godeps/_workspace/src/github.com/minio/minio-go/api-v2.go index c5b765ac..c7b67291 100644 --- a/Godeps/_workspace/src/github.com/minio/minio-go/api-v2.go +++ b/Godeps/_workspace/src/github.com/minio/minio-go/api-v2.go @@ -65,7 +65,7 @@ type ObjectAPI interface { RemoveObject(bucket, object string) error // Drop all incomplete uploads for a given object - DropIncompleteUploads(bucket, object string) <-chan error + DropIncompleteUpload(bucket, object string) <-chan error } // PresignedAPI - object specific for now @@ -177,7 +177,7 @@ type Config struct { // Global constants const ( LibraryName = "minio-go" - LibraryVersion = "0.2.0" + LibraryVersion = "0.2.1" ) // SetUserAgent - append to a default user agent @@ -819,7 +819,7 @@ func (a apiV2) ListBuckets() <-chan BucketStatCh { return ch } -func (a apiV2) dropIncompleteUploadsInRoutine(bucket, object string, errorCh chan error) { +func (a apiV2) dropIncompleteUploadInRoutine(bucket, object string, errorCh chan error) { defer close(errorCh) if err := invalidBucketError(bucket); err != nil { errorCh <- err @@ -835,9 +835,12 @@ func (a apiV2) dropIncompleteUploadsInRoutine(bucket, object string, errorCh cha return } for _, multiPartUpload := range listMultipartUploadsResult.Uploads { - err := a.abortMultipartUpload(bucket, multiPartUpload.Key, multiPartUpload.UploadID) - if err != nil { - errorCh <- err + if object == multiPartUpload.Key { + err := a.abortMultipartUpload(bucket, multiPartUpload.Key, multiPartUpload.UploadID) + if err != nil { + errorCh <- err + return + } return } } @@ -852,9 +855,12 @@ func (a apiV2) dropIncompleteUploadsInRoutine(bucket, object string, errorCh cha return } for _, multiPartUpload := range listMultipartUploadsResult.Uploads { - err := a.abortMultipartUpload(bucket, multiPartUpload.Key, multiPartUpload.UploadID) - if err != nil { - errorCh <- err + if object == multiPartUpload.Key { + err := a.abortMultipartUpload(bucket, multiPartUpload.Key, multiPartUpload.UploadID) + if err != nil { + errorCh <- err + return + } return } } @@ -868,10 +874,10 @@ func (a apiV2) dropIncompleteUploadsInRoutine(bucket, object string, errorCh cha // These set of calls require explicit authentication, no anonymous // requests are allowed for multipart API -// DropIncompleteUploads - abort a specific in progress active multipart upload -func (a apiV2) DropIncompleteUploads(bucket, object string) <-chan error { +// DropIncompleteUpload - abort a specific in progress active multipart upload +func (a apiV2) DropIncompleteUpload(bucket, object string) <-chan error { errorCh := make(chan error) - go a.dropIncompleteUploadsInRoutine(bucket, object, errorCh) + go a.dropIncompleteUploadInRoutine(bucket, object, errorCh) return errorCh } diff --git a/Godeps/_workspace/src/github.com/minio/minio-go/examples/play/dropincompleteuploads.go b/Godeps/_workspace/src/github.com/minio/minio-go/examples/play/dropincompleteuploads.go index 186580d8..da56dd16 100644 --- a/Godeps/_workspace/src/github.com/minio/minio-go/examples/play/dropincompleteuploads.go +++ b/Godeps/_workspace/src/github.com/minio/minio-go/examples/play/dropincompleteuploads.go @@ -32,7 +32,7 @@ func main() { if err != nil { log.Fatalln(err) } - for err := range s3Client.DropIncompleteUploads("mybucket", "myobject") { + for err := range s3Client.DropIncompleteUpload("mybucket", "myobject") { if err != nil { log.Fatalln(err) } diff --git a/Godeps/_workspace/src/github.com/minio/minio-go/examples/s3/dropincompleteuploads.go b/Godeps/_workspace/src/github.com/minio/minio-go/examples/s3/dropincompleteuploads.go index c01ecaef..5353d05f 100644 --- a/Godeps/_workspace/src/github.com/minio/minio-go/examples/s3/dropincompleteuploads.go +++ b/Godeps/_workspace/src/github.com/minio/minio-go/examples/s3/dropincompleteuploads.go @@ -34,7 +34,7 @@ func main() { if err != nil { log.Fatalln(err) } - for err := range s3Client.DropIncompleteUploads("mybucket", "myobject") { + for err := range s3Client.DropIncompleteUpload("mybucket", "myobject") { if err != nil { log.Fatalln(err) }