1
0
mirror of https://github.com/minio/mc.git synced 2025-11-12 01:02:26 +03:00

support for "rm" of objects and buckets

This commit is contained in:
Krishna Srinivas
2015-10-17 00:46:12 -07:00
parent 2a3b201457
commit b4c78a33ff
7 changed files with 242 additions and 0 deletions

View File

@@ -76,6 +76,18 @@ func (c *s3Client) GetObject(offset, length int64) (io.ReadCloser, int64, *probe
return reader, metadata.Size, nil
}
// Remove - remove object or bucket
func (c *s3Client) Remove() *probe.Error {
bucket, object := c.url2BucketAndObject()
var err error
if object == "" {
err = c.api.RemoveBucket(bucket)
} else {
err = c.api.RemoveObject(bucket, object)
}
return probe.NewError(err)
}
// Share - get a usable get object url to share
func (c *s3Client) ShareDownload(expires time.Duration) (string, *probe.Error) {
bucket, object := c.url2BucketAndObject()