Chromium Code Reviews| 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 |