diff --git a/internal/github.com/minio/minio-go/api-v2.go b/internal/github.com/minio/minio-go/api-v2.go index 59ffbb72..62f46891 100644 --- a/internal/github.com/minio/minio-go/api-v2.go +++ b/internal/github.com/minio/minio-go/api-v2.go @@ -72,7 +72,6 @@ type ObjectAPI interface { // PresignedAPI - object specific for now type PresignedAPI interface { PresignedGetObject(bucket, object string, expires time.Duration) (string, error) - PresignedGetPartialObject(bucket, object string, expires time.Duration, offset, length int64) (string, error) } // BucketStatCh - bucket metadata over read channel @@ -235,14 +234,6 @@ func (a apiV2) PresignedGetObject(bucket, object string, expires time.Duration) return a.presignedGetObject(bucket, object, expireSeconds, 0, 0) } -func (a apiV2) PresignedGetPartialObject(bucket, object string, expires time.Duration, offset, length int64) (string, error) { - expireSeconds := int64(expires / time.Second) - if expireSeconds < 1 || expireSeconds > 604800 { - return "", invalidArgumentError("") - } - return a.presignedGetObject(bucket, object, expireSeconds, offset, length) -} - // GetObject retrieve object // Downloads full object with no ranges, if you need ranges use GetPartialObject diff --git a/internal/vendor.json b/internal/vendor.json index 465eb47d..f2e4add5 100755 --- a/internal/vendor.json +++ b/internal/vendor.json @@ -6,8 +6,8 @@ "canonical": "github.com/dustin/go-humanize", "comment": "", "local": "github.com/dustin/go-humanize", - "revision": "555c9466709dddbb3933eb22815b1abf7f6f869f", - "revisionTime": "2015-08-20T20:35:45-07:00" + "revision": "5721d85c9a0e65ee65005e7da48c56612ae04ee3", + "revisionTime": "2015-08-20T22:35:37-07:00" }, { "canonical": "github.com/fatih/color", @@ -20,8 +20,8 @@ "canonical": "github.com/fatih/structs", "comment": "", "local": "github.com/fatih/structs", - "revision": "555c9466709dddbb3933eb22815b1abf7f6f869f", - "revisionTime": "2015-08-20T20:35:45-07:00" + "revision": "5721d85c9a0e65ee65005e7da48c56612ae04ee3", + "revisionTime": "2015-08-20T22:35:37-07:00" }, { "canonical": "github.com/mattn/go-isatty", @@ -41,22 +41,22 @@ "canonical": "github.com/minio/minio-go", "comment": "", "local": "github.com/minio/minio-go", - "revision": "feda9e7303c21b33793ce0f8105e8884b5eee6b1", - "revisionTime": "2015-08-17T20:55:25-07:00" + "revision": "d3dc9fd261cacbe64e4c0e5f3929e1fb846db42b", + "revisionTime": "2015-08-21T20:20:57-07:00" }, { "canonical": "github.com/minio/minio/pkg/probe", "comment": "", "local": "github.com/minio/minio/pkg/probe", - "revision": "555c9466709dddbb3933eb22815b1abf7f6f869f", - "revisionTime": "2015-08-20T20:35:45-07:00" + "revision": "5721d85c9a0e65ee65005e7da48c56612ae04ee3", + "revisionTime": "2015-08-20T22:35:37-07:00" }, { "canonical": "github.com/minio/minio/pkg/quick", "comment": "", "local": "github.com/minio/minio/pkg/quick", - "revision": "555c9466709dddbb3933eb22815b1abf7f6f869f", - "revisionTime": "2015-08-20T20:35:45-07:00" + "revision": "5721d85c9a0e65ee65005e7da48c56612ae04ee3", + "revisionTime": "2015-08-20T22:35:37-07:00" }, { "canonical": "github.com/minio/pb", diff --git a/pkg/client/client.go b/pkg/client/client.go index b89c275b..8dfc4700 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -35,7 +35,7 @@ type Client interface { SetBucketACL(acl string) *probe.Error // Object operations - Share(expires time.Duration, offset, length int64) (string, *probe.Error) + Share(expires time.Duration) (string, *probe.Error) GetObject(offset, length int64) (body io.ReadCloser, size int64, err *probe.Error) PutObject(size int64, data io.Reader) *probe.Error diff --git a/pkg/client/fs/fs.go b/pkg/client/fs/fs.go index cc3c46cf..3179ace6 100644 --- a/pkg/client/fs/fs.go +++ b/pkg/client/fs/fs.go @@ -122,7 +122,7 @@ func (f *fsClient) get() (io.ReadCloser, int64, *probe.Error) { } } -func (f *fsClient) Share(expires time.Duration, offset, length int64) (string, *probe.Error) { +func (f *fsClient) Share(expires time.Duration) (string, *probe.Error) { return "", probe.NewError(client.APINotImplemented{API: "Share", APIType: "filesystem"}) } diff --git a/pkg/client/s3/s3.go b/pkg/client/s3/s3.go index 61b065a6..8fffdaa7 100644 --- a/pkg/client/s3/s3.go +++ b/pkg/client/s3/s3.go @@ -102,9 +102,9 @@ func (c *s3Client) GetObject(offset, length int64) (io.ReadCloser, int64, *probe } // Share - get a usable get object url to share -func (c *s3Client) Share(expires time.Duration, offset, length int64) (string, *probe.Error) { +func (c *s3Client) Share(expires time.Duration) (string, *probe.Error) { bucket, object := c.url2BucketAndObject() - presignedURL, err := c.api.PresignedGetPartialObject(bucket, object, expires, offset, length) + presignedURL, err := c.api.PresignedGetObject(bucket, object, expires) if err != nil { return "", probe.NewError(err) } diff --git a/share-main.go b/share-main.go index e49af900..56884dbf 100644 --- a/share-main.go +++ b/share-main.go @@ -112,7 +112,7 @@ func doShareCmd(targetURL string, recursive bool, expires time.Duration) *probe. if err != nil { return err.Trace() } - presignedURL, err := newClnt.Share(expires, 0, 0) + presignedURL, err := newClnt.Share(expires) if err != nil { return err.Trace() }