Struct garage_model::helper::bucket::BucketHelper
source · pub struct BucketHelper<'a>(/* private fields */);
Implementations§
source§impl<'a> BucketHelper<'a>
impl<'a> BucketHelper<'a>
pub async fn resolve_global_bucket_name( &self, bucket_name: &String ) -> Result<Option<Uuid>, Error>
pub async fn resolve_bucket( &self, bucket_name: &String, api_key: &Key ) -> Result<Uuid, Error>
sourcepub async fn admin_get_existing_matching_bucket(
&self,
pattern: &String
) -> Result<Uuid, Error>
pub async fn admin_get_existing_matching_bucket( &self, pattern: &String ) -> Result<Uuid, Error>
Find a bucket by its global alias or a prefix of its uuid
sourcepub async fn get_internal_bucket(
&self,
bucket_id: Uuid
) -> Result<Bucket, Error>
pub async fn get_internal_bucket( &self, bucket_id: Uuid ) -> Result<Bucket, Error>
Returns a Bucket if it is present in bucket table, even if it is in deleted state. Querying a non-existing bucket ID returns an internal error.
sourcepub async fn get_existing_bucket(
&self,
bucket_id: Uuid
) -> Result<Bucket, Error>
pub async fn get_existing_bucket( &self, bucket_id: Uuid ) -> Result<Bucket, Error>
Returns a Bucket if it is present in bucket table, only if it is in non-deleted state. Querying a non-existing bucket ID or a deleted bucket returns a bad request error.
pub async fn is_bucket_empty(&self, bucket_id: Uuid) -> Result<bool, Error>
sourcepub async fn cleanup_incomplete_uploads(
&self,
bucket_id: &Uuid,
older_than: Duration
) -> Result<usize, Error>
pub async fn cleanup_incomplete_uploads( &self, bucket_id: &Uuid, older_than: Duration ) -> Result<usize, Error>
Deletes all incomplete multipart uploads that are older than a certain time. Returns the number of uploads aborted. This will also include non-multipart uploads, which may be lingering after a node crash
Auto Trait Implementations§
impl<'a> Freeze for BucketHelper<'a>
impl<'a> !RefUnwindSafe for BucketHelper<'a>
impl<'a> Send for BucketHelper<'a>
impl<'a> Sync for BucketHelper<'a>
impl<'a> Unpin for BucketHelper<'a>
impl<'a> !UnwindSafe for BucketHelper<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more