Here is an example program. Note that I am running on Google Compute Engine, so I can make use of service accounts, which means that I don't manipulate the access-token directly at all. Although I could make a generic REST call to the JSON API to accomplish what I want, but I'd of course rather use the client library just for convenience.
package main
import (
"fmt"
"os"
)
func main() {
client, err := serviceaccount.NewClient(&serviceaccount.Options{})
if err != nil {
fmt.Fprintf(os.Stderr, "Failed to create service account client: %v\n", err)
os.Exit(1)
}
filename := "5105650963054592/2014-01-27-15-01-29-01-04-146bc100000000-12972000000000-11fbc100000000.json"
bucket := "fs-staging-cooked-events"
service, _ := storage.New(client)
obj, err := service.Objects.Get(bucket, filename).Do()
if err != nil {
fmt.Fprintf(os.Stderr, "Failed to GET %s/%s: %v\n", bucket, filename, err)
os.Exit(1)
}
fmt.Printf("Found %s/%s...\n", bucket, filename)
fmt.Printf("MediaLink: %s\n", obj.MediaLink)
fmt.Printf("SelfLink: %s\n", obj.SelfLink)