Skip to main content

empty_s3_bucket

Function empty_s3_bucket 

Source
pub async fn empty_s3_bucket(
    location: StorageConfig,
    credentials: S3Credentials,
    clock: ClockRef,
    ids: IdSourceRef,
) -> Result<EmptiedS3Bucket, EmptyS3BucketError>
Expand description

Delete every object and abort every unfinished upload in an S3 location’s bucket, whatever wrote them, and return how many of each went (E14). A bucket whose root holds anything but stores’ folders and the location marker is refused with EmptyS3BucketError::OtherFiles before anything is removed. The first failure stops it; calling again finishes. Retained versions in a versioned bucket stay. It uses the app’s clock and ids, the ones given to CovenBuilder::clock and CovenBuilder::id_source, and makes none of its own.