Last active
August 29, 2015 14:25
-
-
Save christopherhesse/fee14d722b60121725dc to your computer and use it in GitHub Desktop.
appengine image API with GCS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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