Last active
August 29, 2015 14:25
-
-
Save christopherhesse/47f2a074daaef5fa4bf6 to your computer and use it in GitHub Desktop.
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 ( | |
"code.google.com/p/goauth2/appengine/serviceaccount" | |
"golang.org/x/net/context" | |
"appengine" | |
) | |
// oauth2 module requires a context.Context so use goauth2 for now | |
func CloudContext(c appengine.Context, scopes ...string) context.Context { | |
client, _ := serviceaccount.NewClient(c, scopes...) | |
return cloud.WithContext(context.Background(), appengine.AppID(c), client) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment