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 datastore | 5 package datastore |
6 | 6 |
7 import ( | 7 import ( |
8 "fmt" | 8 "fmt" |
9 | 9 |
10 "golang.org/x/net/context" | 10 "golang.org/x/net/context" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // be decoded by the implementation. | 122 // be decoded by the implementation. |
123 DecodeCursor(s string) (Cursor, error) | 123 DecodeCursor(s string) (Cursor, error) |
124 | 124 |
125 // Run executes the given query, and calls `cb` for each successfully it
em. | 125 // Run executes the given query, and calls `cb` for each successfully it
em. |
126 // | 126 // |
127 // NOTE: Implementations and filters are guaranteed that: | 127 // NOTE: Implementations and filters are guaranteed that: |
128 // - query is not nil | 128 // - query is not nil |
129 // - cb is not nil | 129 // - cb is not nil |
130 Run(q *FinalizedQuery, cb RawRunCB) error | 130 Run(q *FinalizedQuery, cb RawRunCB) error |
131 | 131 |
| 132 // Count executes the given query and returns the number of entries whic
h |
| 133 // match it. |
| 134 Count(q *FinalizedQuery) (int64, error) |
| 135 |
132 // GetMulti retrieves items from the datastore. | 136 // GetMulti retrieves items from the datastore. |
133 // | 137 // |
134 // Callback execues once per key, in the order of keys. Callback may not | 138 // Callback execues once per key, in the order of keys. Callback may not |
135 // execute at all if there's a server error. If callback is nil, this | 139 // execute at all if there's a server error. If callback is nil, this |
136 // method does nothing. | 140 // method does nothing. |
137 // | 141 // |
138 // meta is used to propagate metadata from higher levels. | 142 // meta is used to propagate metadata from higher levels. |
139 // | 143 // |
140 // NOTE: Implementations and filters are guaranteed that: | 144 // NOTE: Implementations and filters are guaranteed that: |
141 // - len(keys) > 0 | 145 // - len(keys) > 0 |
(...skipping 22 matching lines...) Expand all Loading... |
164 // - len(keys) > 0 | 168 // - len(keys) > 0 |
165 // - all keys are Valid, !Incomplete, and in the current namespace | 169 // - all keys are Valid, !Incomplete, and in the current namespace |
166 // - none keys of the keys are 'special' (use a kind prefixed with '__
') | 170 // - none keys of the keys are 'special' (use a kind prefixed with '__
') |
167 // - cb is not nil | 171 // - cb is not nil |
168 DeleteMulti(keys []*Key, cb DeleteMultiCB) error | 172 DeleteMulti(keys []*Key, cb DeleteMultiCB) error |
169 | 173 |
170 // Testable returns the Testable interface for the implementation, or ni
l if | 174 // Testable returns the Testable interface for the implementation, or ni
l if |
171 // there is none. | 175 // there is none. |
172 Testable() Testable | 176 Testable() Testable |
173 } | 177 } |
OLD | NEW |