From 203cc599e5e2f2f821dc75b47c5a4c9073333f05 Mon Sep 17 00:00:00 2001 From: Derek Perkins Date: Thu, 16 May 2024 20:34:17 -0600 Subject: [PATCH] feat(storage): add BucketName to BucketHandle (#10127) The bucket name is currently only accessible via the Attrs() network call, and can be trivially returned from the bucket handle. Today we have to pass around a `BucketHandle` and the bucket name separately. I used BucketName instead of just Name, as ObjectHandle has both BucketName and ObjectName. --- storage/bucket.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/storage/bucket.go b/storage/bucket.go index d2da86e914b3..28437c518fe2 100644 --- a/storage/bucket.go +++ b/storage/bucket.go @@ -116,6 +116,11 @@ func (b *BucketHandle) DefaultObjectACL() *ACLHandle { return &b.defaultObjectACL } +// BucketName returns the name of the bucket. +func (b *BucketHandle) BucketName() string { + return b.name +} + // Object returns an ObjectHandle, which provides operations on the named object. // This call does not perform any network operations such as fetching the object or verifying its existence. // Use methods on ObjectHandle to perform network operations.