Last active
August 29, 2015 14:14
-
-
Save tnuki10/8081b945ab8db0f95f38 to your computer and use it in GitHub Desktop.
GAEからGoogle Cloud Storage Go Client Libraryを利用(認証)
This file contains 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
// google.golang.org/cloud でcontextを作ると、GCPの各サービス用のライブラリが使えるようになるっぽい。 | |
c := appengine.NewContext(r) | |
tokenSource := google.AppEngineTokenSource(c, storage.ScopeFullControl) | |
client := oauth2.NewClient( | |
c, | |
tokenSource, | |
) | |
ctx := cloud.NewContext(appengine.AppID(c), client) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment