Skip to content

Commit

Permalink
Merge pull request #152 from harshavardhana/presigned
Browse files Browse the repository at this point in the history
Deprecate presignedGetPartialObject() API
  • Loading branch information
Harshavardhana committed Aug 22, 2015
2 parents feda9e7 + d57030b commit d3dc9fd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
9 changes: 0 additions & 9 deletions api-v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions api_public_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,6 @@ func TestPresignedURL(t *testing.T) {
if url == "" {
t.Fatalf("Error")
}
url, err = a.PresignedGetPartialObject("bucket", "object", time.Duration(1000)*time.Second, 5, 11)
if err != nil {
t.Fatalf("Error")
}
if url == "" {
t.Fatalf("Error")
}
_, err = a.PresignedGetObject("bucket", "object", time.Duration(0)*time.Second)
if err == nil {
t.Fatalf("Error")
Expand Down

0 comments on commit d3dc9fd

Please sign in to comment.