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))))) |
+} |