Skip to content

Commit

Permalink
feat(storage): add BucketName to BucketHandle (googleapis#10127)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
derekperkins committed May 17, 2024
1 parent 4bb12e6 commit 203cc59
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions storage/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 203cc59

Please sign in to comment.