Merge pull request #988 from harshavardhana/deps-update

Update minio-go to latest release 0.2.1
This commit is contained in:
Harshavardhana
2015-08-12 01:11:25 -07:00
11 changed files with 35 additions and 26 deletions
+3 -3
View File
@@ -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",
+3
View File
@@ -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
+1 -1
View File
@@ -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)
}
+2 -2
View File
@@ -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"},
+1 -1
View File
@@ -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)
}
+3 -3
View File
@@ -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"},
+1 -1
View File
@@ -18,7 +18,7 @@ func Comma(v int64) string {
v = 0 - v
}
parts := []string{"", "", "", "", "", "", "", ""}
parts := []string{"", "", "", "", "", "", ""}
j := len(parts) - 1
for v > 999 {
+1 -1
View File
@@ -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)
+18 -12
View File
@@ -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
}
@@ -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)
}
@@ -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)
}