2
votes

I'm using Golang package storage v1 to upload files to Google Cloud Storage, using the following method:

func (r *ObjectsService) Insert(bucket string, object *Object) *ObjectsInsertCall
Insert: Stores a new object and metadata.

Everything works great except I'm not sure how to publicly expose uploaded files, using Google's developers console I can manually set a file public by clicking the Public link checkbox, Any idea how do I achieve the same result using the above API? an example would be highly appreciated

1

1 Answers

2
votes

There's a PredefinedAcl function on ObjectsInsertCall. Predefined ACLs are described in the API documentation, but one of them is "public-read", which marks the object as globally viewable.