Skip to content

Instantly share code, notes, and snippets.

@christopherhesse
Last active August 29, 2015 14:25
Show Gist options
  • Save christopherhesse/fee14d722b60121725dc to your computer and use it in GitHub Desktop.
Save christopherhesse/fee14d722b60121725dc to your computer and use it in GitHub Desktop.
appengine image API with GCS
import (
"appengine/blobstore"
aeimage "appengine/image"
)
func servingURL(c appengine.Context) error {
blobKey, err := blobstore.BlobKeyForFile(c, "/gs/bucketname/file")
if err != nil {
return err
}
servingURL, err := aeimage.ServingURL(c, blobKey, &aeimage.ServingURLOptions{Secure: true})
if err != nil {
return err
}
c.Infof("servingURL: %s", servingURL.String())
return nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment