Chromium Code Reviews| 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 "golang.org/x/net/context" | 8 "golang.org/x/net/context" |
| 9 ) | 9 ) |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 // func(obj TYPE, getCursor CursorCB) bool | 93 // func(obj TYPE, getCursor CursorCB) bool |
| 94 // | 94 // |
| 95 // Where TYPE is one of: | 95 // Where TYPE is one of: |
| 96 // - S or *S where S is a struct | 96 // - S or *S where S is a struct |
| 97 // - P or *P where *P is a concrete type implementing PropertyLoadSave r | 97 // - P or *P where *P is a concrete type implementing PropertyLoadSave r |
| 98 // - *Key (implies a keys-only query) | 98 // - *Key (implies a keys-only query) |
| 99 // | 99 // |
| 100 // Run stops on the first error encountered. | 100 // Run stops on the first error encountered. |
| 101 Run(q *Query, cb interface{}) error | 101 Run(q *Query, cb interface{}) error |
| 102 | 102 |
| 103 // Count is a convenience method to count the number of results that a q uery | |
| 104 // has. It does this by running the keys-only version of q and counting. No | |
| 105 // magic here. | |
| 106 Count(q *Query) (int64, error) | |
|
Vadim Sh.
2015/09/24 18:40:11
Is it how ndb's count() work? I though there IS ma
iannucci
2015/09/24 18:59:30
So I took a look... it seems like there's actually
| |
| 107 | |
| 103 // DecodeCursor converts a string returned by a Cursor into a Cursor ins tance. | 108 // DecodeCursor converts a string returned by a Cursor into a Cursor ins tance. |
| 104 // It will return an error if the supplied string is not valid, or could not | 109 // It will return an error if the supplied string is not valid, or could not |
| 105 // be decoded by the implementation. | 110 // be decoded by the implementation. |
| 106 DecodeCursor(string) (Cursor, error) | 111 DecodeCursor(string) (Cursor, error) |
| 107 | 112 |
| 108 // GetAll retrieves all of the Query results into dst. | 113 // GetAll retrieves all of the Query results into dst. |
| 109 // | 114 // |
| 110 // dst must be one of: | 115 // dst must be one of: |
| 111 // - *[]S or *[]*S where S is a struct | 116 // - *[]S or *[]*S where S is a struct |
| 112 // - *[]P or *[]*P where *P is a concrete type implementing | 117 // - *[]P or *[]*P where *P is a concrete type implementing |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 | 166 |
| 162 // Testable returns the Testable interface for the implementation, or ni l if | 167 // Testable returns the Testable interface for the implementation, or ni l if |
| 163 // there is none. | 168 // there is none. |
| 164 Testable() Testable | 169 Testable() Testable |
| 165 | 170 |
| 166 // Raw returns the underlying RawInterface. The Interface and RawInterfa ce may | 171 // Raw returns the underlying RawInterface. The Interface and RawInterfa ce may |
| 167 // be used interchangably; there's no danger of interleaving access to t he | 172 // be used interchangably; there's no danger of interleaving access to t he |
| 168 // datastore via the two. | 173 // datastore via the two. |
| 169 Raw() RawInterface | 174 Raw() RawInterface |
| 170 } | 175 } |
| OLD | NEW |