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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 return r.c.PutMulti.up(r.ds.PutMulti(keys, vals, cb)) | 71 return r.c.PutMulti.up(r.ds.PutMulti(keys, vals, cb)) |
72 } | 72 } |
73 | 73 |
74 func (r *dsCounter) Testable() ds.Testable { | 74 func (r *dsCounter) Testable() ds.Testable { |
75 return r.ds.Testable() | 75 return r.ds.Testable() |
76 } | 76 } |
77 | 77 |
78 // FilterRDS installs a counter datastore filter in the context. | 78 // FilterRDS installs a counter datastore filter in the context. |
79 func FilterRDS(c context.Context) (context.Context, *DSCounter) { | 79 func FilterRDS(c context.Context) (context.Context, *DSCounter) { |
80 state := &DSCounter{} | 80 state := &DSCounter{} |
| 81 state.NewKey.init() |
| 82 state.DecodeCursor.init() |
| 83 state.DecodeKey.init() |
| 84 state.NewQuery.init() |
| 85 state.RunInTransaction.init() |
| 86 state.Run.init() |
| 87 state.DeleteMulti.init() |
| 88 state.GetMulti.init() |
| 89 state.PutMulti.init() |
| 90 |
81 return ds.AddRawFilters(c, func(ic context.Context, ds ds.RawInterface)
ds.RawInterface { | 91 return ds.AddRawFilters(c, func(ic context.Context, ds ds.RawInterface)
ds.RawInterface { |
82 return &dsCounter{state, ds} | 92 return &dsCounter{state, ds} |
83 }), state | 93 }), state |
84 } | 94 } |
OLD | NEW |