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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 NewQuery(kind string) Query | 158 NewQuery(kind string) Query |
159 | 159 |
160 // RunInTransaction runs f in a transaction. | 160 // RunInTransaction runs f in a transaction. |
161 // | 161 // |
162 // opts may be nil. | 162 // opts may be nil. |
163 // | 163 // |
164 // NOTE: Implementations and filters are guaranteed that: | 164 // NOTE: Implementations and filters are guaranteed that: |
165 // - f is not nil | 165 // - f is not nil |
166 RunInTransaction(f func(c context.Context) error, opts *TransactionOptio
ns) error | 166 RunInTransaction(f func(c context.Context) error, opts *TransactionOptio
ns) error |
167 | 167 |
| 168 // DecodeCursor converts a string returned by a Cursor into a Cursor ins
tance. |
| 169 // It will return an error if the supplied string is not valid, or could
not |
| 170 // be decoded by the implementation. |
| 171 DecodeCursor(s string) (Cursor, error) |
| 172 |
168 // Run executes the given query, and calls `cb` for each successfully it
em. | 173 // Run executes the given query, and calls `cb` for each successfully it
em. |
169 // | 174 // |
170 // NOTE: Implementations and filters are guaranteed that: | 175 // NOTE: Implementations and filters are guaranteed that: |
171 // - query is not nil | 176 // - query is not nil |
172 // - cb is not nil | 177 // - cb is not nil |
173 Run(q Query, cb RawRunCB) error | 178 Run(q Query, cb RawRunCB) error |
174 | 179 |
175 // GetMulti retrieves items from the datastore. | 180 // GetMulti retrieves items from the datastore. |
176 // | 181 // |
177 // Callback execues once per key, in the order of keys. Callback may not | 182 // Callback execues once per key, in the order of keys. Callback may not |
(...skipping 29 matching lines...) Expand all Loading... |
207 // - len(keys) > 0 | 212 // - len(keys) > 0 |
208 // - all keys are Valid, !Incomplete, and in the current namespace | 213 // - all keys are Valid, !Incomplete, and in the current namespace |
209 // - none keys of the keys are 'special' (use a kind prefixed with '__
') | 214 // - none keys of the keys are 'special' (use a kind prefixed with '__
') |
210 // - cb is not nil | 215 // - cb is not nil |
211 DeleteMulti(keys []Key, cb DeleteMultiCB) error | 216 DeleteMulti(keys []Key, cb DeleteMultiCB) error |
212 | 217 |
213 // Testable returns the Testable interface for the implementation, or ni
l if | 218 // Testable returns the Testable interface for the implementation, or ni
l if |
214 // there is none. | 219 // there is none. |
215 Testable() Testable | 220 Testable() Testable |
216 } | 221 } |
OLD | NEW |