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

Side by Side Diff: filter/count/rds.go

Issue 1285703002: Add testable interface for datastore. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: fixes after Raw change Created 5 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 unified diff | Download patch
« no previous file with comments | « doc.go ('k') | impl/dummy/dummy.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 59
60 func (r *dsCounter) GetMulti(keys []ds.Key, meta ds.MultiMetaGetter, cb ds.GetMu ltiCB) 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, meta, 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 func (r *dsCounter) Testable() ds.Testable {
69 return r.ds.Testable()
70 }
71
68 // FilterRDS installs a counter datastore filter in the context. 72 // FilterRDS installs a counter datastore filter in the context.
69 func FilterRDS(c context.Context) (context.Context, *DSCounter) { 73 func FilterRDS(c context.Context) (context.Context, *DSCounter) {
70 state := &DSCounter{} 74 state := &DSCounter{}
71 return ds.AddRawFilters(c, func(ic context.Context, ds ds.RawInterface) ds.RawInterface { 75 return ds.AddRawFilters(c, func(ic context.Context, ds ds.RawInterface) ds.RawInterface {
72 return &dsCounter{state, ds} 76 return &dsCounter{state, ds}
73 }), state 77 }), state
74 } 78 }
OLDNEW
« no previous file with comments | « doc.go ('k') | impl/dummy/dummy.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698