Skip to content

Commit

Permalink
Merge pull request #84 from lytics/feat-add-create-bucket-with-location
Browse files Browse the repository at this point in the history
implement CreateBucketWithLocation
  • Loading branch information
bpopadiuk authored Feb 12, 2021
2 parents ffaa16e + bf09242 commit 55455c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion google/apistore.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ func (c *APIStore) BucketExists(name string) bool {

// CreateBucket creates a new bucket in GCS
func (c *APIStore) CreateBucket(name string) error {
bucket := &storage.Bucket{Name: name}
return c.CreateBucketWithLocation(name, "")
}

// CreateBucketWithLocation creates a new bucket in GCS with the specified location
func (c *APIStore) CreateBucketWithLocation(name, location string) error {
bucket := &storage.Bucket{Name: name, Location: location}
_, err := c.service.Buckets.Insert(c.project, bucket).Do()
return err
}
Expand Down

0 comments on commit 55455c6

Please sign in to comment.