示例#1
0
文件: s3.go 项目: 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)
}
示例#2
0
文件: s3.go 项目: 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)
}