// deleteBucket metadata entry for the given nested bucket. Does nothing if
// nested bucket metadata does not exist.
482640
func (bm *bucketMeta) deleteBucket(name []byte) {
	bm.bucketsLock.Lock()
	delete(bm.buckets, string(name))
	bm.bucketsLock.Unlock()

}
66894
func undoMakeBucket(storageDisks []StorageAPI, bucket string) {
	// Initialize sync waitgroup.
	var wg = &sync.WaitGroup{}
	// Undo previous make bucket entry on all underlying storage disks.
	for index, disk := range storageDisks {
		if disk == nil {
			continue
		}
		wg.Add(1)
		// Delete a bucket inside a go-routine.
		go func(index int, disk StorageAPI) {
			defer wg.Done()
			_ = disk.DeleteVol(bucket)
		}(index, disk)
	}

	// Wait for all make vol to finish.
	wg.Wait()
}
1048788
func (s Storage) Delete(bucket, key string, nested ...string) Storage {
	return s.execute(bucket, key, nil, nested, remove)
}
66879
func (s *DeleteObjectInput) SetBucket(v string) *DeleteObjectInput {
	s.Bucket = &v
	return s
}
110337
func (a *azureObjects) DeleteBucket(ctx context.Context, bucket string) error {
	container := a.client.GetContainerReference(bucket)
	err := container.Delete(nil)
	return azureToObjectError(err, bucket)
}
354309
func (c *Client) DeleteBucket(ctx context.Context, id platform.ID) error {
	return c.db.Update(func(tx *bolt.Tx) error {
		var err error
		if pe := c.deleteBucket(ctx, tx, id); pe != nil {
			pe.Op = getOp(platform.OpDeleteBucket)
			err = pe
		}
		return err
	})
}
756107
func (c Client) removeBucketPolicy(bucketName string) error {
	// Input validation.
	if err := s3utils.CheckValidBucketName(bucketName); err != nil {
		return err
	}
	// Get resources properly escaped and lined up before
	// using them in http request.
	urlValues := make(url.Values)
	urlValues.Set("policy", "")

	// Execute DELETE on objectName.
	resp, err := c.executeMethod(context.Background(), "DELETE", requestMetadata{
		bucketName:       bucketName,
		queryValues:      urlValues,
		contentSHA256Hex: emptySHA256Hex,
	})
	defer closeResponse(resp)
	if err != nil {
		return err
	}
	return nil
}
1164985
func (s *DeleteBucketMetricsConfigurationInput) SetBucket(v string) *DeleteBucketMetricsConfigurationInput {
	s.Bucket = &v
	return s
}
305567
func (s *Service) DeleteBucket(ctx context.Context, id platform.ID) error {
	if _, err := s.FindBucketByID(ctx, id); err != nil {
		return &platform.Error{
			Op:  OpPrefix + platform.OpDeleteBucket,
			Err: err,
		}
	}
	s.bucketKV.Delete(id.String())

	// return s.deleteLabel(ctx, platform.LabelFilter{ResourceID: id})
	return nil
}
443866
func (b *Bucket) Delete(k string) error {
	return b.Write(k, 0, 0, nil, Raw)
}
898782
func (s *DeleteObjectTaggingInput) SetBucket(v string) *DeleteObjectTaggingInput {
	s.Bucket = &v
	return s
}
402880
func (bk *Backend) DeleteBucket(parent []string, bucket string) error {
	fullBucket := append(parent, bucket)

	err := os.Remove(bk.flatten(fullBucket))
	if err != nil {
		return trace.ConvertSystemError(err)
	}

	return nil
}
388876
func (fs *FSObjects) DeleteBucket(ctx context.Context, bucket string) error {
	bucketLock := fs.nsMutex.NewNSLock(bucket, "")
	if err := bucketLock.GetLock(globalObjectTimeout); err != nil {
		logger.LogIf(ctx, err)
		return err
	}
	defer bucketLock.Unlock()
	bucketDir, err := fs.getBucketDir(ctx, bucket)
	if err != nil {
		return toObjectErr(err, bucket)
	}

	// Attempt to delete regular bucket.
	if err = fsRemoveDir(ctx, bucketDir); err != nil {
		return toObjectErr(err, bucket)
	}

	// Cleanup all the bucket metadata.
	minioMetadataBucketDir := pathJoin(fs.fsPath, minioMetaBucket, bucketMetaPrefix, bucket)
	if err = fsRemoveAll(ctx, minioMetadataBucketDir); err != nil {
		return toObjectErr(err, bucket)
	}

	// Delete all bucket metadata.
	deleteBucketMetadata(ctx, bucket, fs)

	return nil
}
1281267
func (r *bucketLocationCache) Delete(bucketName string) {
	r.Lock()
	defer r.Unlock()
	delete(r.items, bucketName)
}
845895
func (s *xlSets) DeleteBucketPolicy(ctx context.Context, bucket string) error {
	return removePolicyConfig(ctx, s, bucket)
}
290120
func (tx *Tx) DeleteBucket(name []byte) error {
	return tx.root.DeleteBucket(name)
}
286432
func (s *DeleteBucketReplicationInput) SetBucket(v string) *DeleteBucketReplicationInput {
	s.Bucket = &v
	return s
}