Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Unified Diff: impl/prod/context.go

Issue 1247283003: Improve docs (Closed) Base URL: https://github.com/luci/gae.git@reduce_size
Patch Set: fix comments Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « impl/memory/raw_datastore_data.go ('k') | service/info/context.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/prod/context.go
diff --git a/impl/prod/context.go b/impl/prod/context.go
index 401e10ef5a2f5a1583a8e4841bb5bc0bc8a287c4..6193547f90ce4d610b2755500fe35fffb9e9bf60 100644
--- a/impl/prod/context.go
+++ b/impl/prod/context.go
@@ -5,10 +5,14 @@
package prod
import (
+ "net/http"
+
"golang.org/x/net/context"
+ "google.golang.org/appengine"
)
-// Use adds production implementations for all the gae services to the context.
+// Use adds production implementations for all the gae services to the context,
+// using the existing context obtained by appengine.NewContext.
//
// The services added are:
// - github.com/luci/gae/service/rawdatastore
@@ -22,3 +26,18 @@ import (
func Use(c context.Context) context.Context {
return useRDS(useMC(useTQ(useGI(c))))
}
+
+// Use adds production implementations for all the gae services to the context.
+//
+// The services added are:
+// - github.com/luci/gae/service/rawdatastore
+// - github.com/luci/gae/service/taskqueue
+// - github.com/luci/gae/service/memcache
+// - github.com/luci/gae/service/info
+//
+// These can be retrieved with the <service>.Get functions.
+//
+// The implementations are all backed by the real appengine SDK functionality,
+func UseRequest(r *http.Request) context.Context {
+ return useRDS(useMC(useTQ(useGI(appengine.NewContext(r)))))
+}
« no previous file with comments | « impl/memory/raw_datastore_data.go ('k') | service/info/context.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698