Beispiel #1
0
Datei: s3.go Projekt: bosky101/mc
// SetBucketACL add canned acl's on a bucket
func (c *s3Client) SetBucketACL(acl string) error {
	bucket, object := c.url2BucketAndObject()
	if object != "" {
		return iodine.New(client.InvalidQueryURL{URL: c.hostURL.String()}, nil)
	}
	err := c.api.SetBucketACL(bucket, s3.BucketACL(acl))
	return iodine.New(err, nil)
}
Beispiel #2
0
Datei: s3.go Projekt: bosky101/mc
// MakeBucket - make a new bucket
func (c *s3Client) MakeBucket() error {
	bucket, object := c.url2BucketAndObject()
	if object != "" {
		return iodine.New(client.InvalidQueryURL{URL: c.hostURL.String()}, nil)
	}
	// location string is intentionally left out
	err := c.api.MakeBucket(bucket, s3.BucketACL("private"))
	return iodine.New(err, nil)
}