MCPcopy Create free account
hub / github.com/aptly-dev/aptly / delete

Method delete

s3/server_test.go:480–490  ·  view source on GitHub ↗

DELETE on a bucket deletes the bucket if it's not empty.

(a *action)

Source from the content-addressed store, hash-verified

478
479// DELETE on a bucket deletes the bucket if it's not empty.
480func (r bucketResource) delete(a *action) interface{} {
481 b := r.bucket
482 if b == nil {
483 fatalError(404, "NoSuchBucket", "The specified bucket does not exist")
484 }
485 if len(b.objects) > 0 {
486 fatalError(400, "BucketNotEmpty", "The bucket you tried to delete is not empty")
487 }
488 delete(a.srv.buckets, b.name)
489 return nil
490}
491
492// PUT on a bucket creates the bucket.
493// http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUT.html

Callers

nothing calls this directly

Calls 1

fatalErrorFunction · 0.85

Tested by

no test coverage detected