| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package count | 5 package count |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "golang.org/x/net/context" | 8 "golang.org/x/net/context" |
| 9 | 9 |
| 10 ds "github.com/luci/gae/service/datastore" | 10 ds "github.com/luci/gae/service/datastore" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 } | 50 } |
| 51 | 51 |
| 52 func (r *dsCounter) RunInTransaction(f func(context.Context) error, opts *ds.Tra
nsactionOptions) error { | 52 func (r *dsCounter) RunInTransaction(f func(context.Context) error, opts *ds.Tra
nsactionOptions) error { |
| 53 return r.c.RunInTransaction.up(r.ds.RunInTransaction(f, opts)) | 53 return r.c.RunInTransaction.up(r.ds.RunInTransaction(f, opts)) |
| 54 } | 54 } |
| 55 | 55 |
| 56 func (r *dsCounter) DeleteMulti(keys []ds.Key, cb ds.DeleteMultiCB) error { | 56 func (r *dsCounter) DeleteMulti(keys []ds.Key, cb ds.DeleteMultiCB) error { |
| 57 return r.c.DeleteMulti.up(r.ds.DeleteMulti(keys, cb)) | 57 return r.c.DeleteMulti.up(r.ds.DeleteMulti(keys, cb)) |
| 58 } | 58 } |
| 59 | 59 |
| 60 func (r *dsCounter) GetMulti(keys []ds.Key, cb ds.GetMultiCB) error { | 60 func (r *dsCounter) GetMulti(keys []ds.Key, meta ds.MultiMetaGetter, cb ds.GetMu
ltiCB) error { |
| 61 » return r.c.GetMulti.up(r.ds.GetMulti(keys, cb)) | 61 » return r.c.GetMulti.up(r.ds.GetMulti(keys, meta, cb)) |
| 62 } | 62 } |
| 63 | 63 |
| 64 func (r *dsCounter) PutMulti(keys []ds.Key, vals []ds.PropertyMap, cb ds.PutMult
iCB) error { | 64 func (r *dsCounter) PutMulti(keys []ds.Key, vals []ds.PropertyMap, cb ds.PutMult
iCB) error { |
| 65 return r.c.PutMulti.up(r.ds.PutMulti(keys, vals, cb)) | 65 return r.c.PutMulti.up(r.ds.PutMulti(keys, vals, cb)) |
| 66 } | 66 } |
| 67 | 67 |
| 68 // FilterRDS installs a counter datastore filter in the context. | 68 // FilterRDS installs a counter datastore filter in the context. |
| 69 func FilterRDS(c context.Context) (context.Context, *DSCounter) { | 69 func FilterRDS(c context.Context) (context.Context, *DSCounter) { |
| 70 state := &DSCounter{} | 70 state := &DSCounter{} |
| 71 return ds.AddRawFilters(c, func(ic context.Context, ds ds.RawInterface)
ds.RawInterface { | 71 return ds.AddRawFilters(c, func(ic context.Context, ds ds.RawInterface)
ds.RawInterface { |
| 72 return &dsCounter{state, ds} | 72 return &dsCounter{state, ds} |
| 73 }), state | 73 }), state |
| 74 } | 74 } |
| OLD | NEW |