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

Unified Diff: doc.go

Issue 2302743002: Interface update, per-method Contexts. (Closed)
Patch Set: Created 4 years, 4 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 | « no previous file | docs/present/lightning/gae_test.go » ('j') | filter/featureBreaker/gi.go » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: doc.go
diff --git a/doc.go b/doc.go
index 70d7033b0c7d7b17e11c343a4011083d9cb92b18..3f91330af95d1c11fb674ca91adf727786077e29 100644
--- a/doc.go
+++ b/doc.go
@@ -63,9 +63,8 @@
// }
//
// func innerHandler(c context.Context, w http.ResponseWriter) {
-// rds := datastore.Get(c)
// obj := &CoolStruct{Value: "hello"}
-// if err := rds.Put(obj); err != nil {
+// if err := rds.Put(c, obj); err != nil {
// http.Error(w, err.String(), http.StatusInternalServerError)
// }
// fmt.Fprintf(w, "I wrote: %s", ds.KeyForObj(obj))
@@ -178,15 +177,11 @@
// }
//
// func CoolFunc(c context.Context, ...) {
-// ds := datastore.Get(c) // returns a datastore.Interface object
-// mc := memcache.Get(c) // returns a memcache.Interface object
-// // use them here
-//
// // don't pass ds/mc/etc. directly, pass the context instead.
iannucci 2016/09/16 01:01:13 this comment no longer makes sense
dnj 2016/09/16 05:44:42 Done.
// SomeOtherFunction(c, ...)
//
// // because you might need to:
-// ds.RunInTransaction(func (c context.Context) error {
+// ds.RunInTransaction(c, func (c context.Context) error {
// SomeOtherFunction(c, ...) // c contains transactional versions of everything
// }, nil)
// }
@@ -203,10 +198,10 @@
// <count filter (counts how many times each API is actually hit)>
// memory datastore.RawInterface implementation
//
-// So datastore.Get would return the full stack. In code, this would look
+// So datastore.Raw would return the full stack. In code, this would look
iannucci 2016/09/16 01:01:13 Nor does this one
dnj 2016/09/16 05:44:42 Done.
// like:
// func HTTPHandler(r *http.Request) {
-// c := prod.UseRequest(r) // production datastore
+// c := prod.UseRequest(r) // production datastore
// c, rawCount := count.FilterRDS(c) // add count filter
// c = dscache.FilterRDS(c) // add dscache filter
// c, userCount := count.FilterRDS(c) // add another count filter
« no previous file with comments | « no previous file | docs/present/lightning/gae_test.go » ('j') | filter/featureBreaker/gi.go » ('J')

Powered by Google App Engine
This is Rietveld 408576698