Use humanize constants for KiB, MiB and GiB units. (#3322)

This commit is contained in:
Bala FA
2016-11-22 18:18:22 -08:00
committed by Harshavardhana
parent c1ebcbcda2
commit 825000bc34
23 changed files with 170 additions and 135 deletions

View File

@@ -27,6 +27,7 @@ import (
"encoding/json"
humanize "github.com/dustin/go-humanize"
"github.com/pkg/profile"
)
@@ -112,9 +113,9 @@ func checkValidMD5(md5 string) ([]byte, error) {
/// http://docs.aws.amazon.com/AmazonS3/latest/dev/UploadingObjects.html
const (
// maximum object size per PUT request is 5GiB
maxObjectSize = 1024 * 1024 * 1024 * 5
// minimum Part size for multipart upload is 5MB
minPartSize = 1024 * 1024 * 5
maxObjectSize = 5 * humanize.GiByte
// minimum Part size for multipart upload is 5MiB
minPartSize = 5 * humanize.MiByte
// maximum Part ID for multipart upload is 10000 (Acceptable values range from 1 to 10000 inclusive)
maxPartID = 10000
)