| 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 executes the given query and returns the number of entries whic
h |
| 104 // match it. |
| 105 Count(q *Query) (int64, error) |
| 106 |
| 103 // DecodeCursor converts a string returned by a Cursor into a Cursor ins
tance. | 107 // 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 | 108 // It will return an error if the supplied string is not valid, or could
not |
| 105 // be decoded by the implementation. | 109 // be decoded by the implementation. |
| 106 DecodeCursor(string) (Cursor, error) | 110 DecodeCursor(string) (Cursor, error) |
| 107 | 111 |
| 108 // GetAll retrieves all of the Query results into dst. | 112 // GetAll retrieves all of the Query results into dst. |
| 109 // | 113 // |
| 110 // dst must be one of: | 114 // dst must be one of: |
| 111 // - *[]S or *[]*S where S is a struct | 115 // - *[]S or *[]*S where S is a struct |
| 112 // - *[]P or *[]*P where *P is a concrete type implementing | 116 // - *[]P or *[]*P where *P is a concrete type implementing |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 165 |
| 162 // Testable returns the Testable interface for the implementation, or ni
l if | 166 // Testable returns the Testable interface for the implementation, or ni
l if |
| 163 // there is none. | 167 // there is none. |
| 164 Testable() Testable | 168 Testable() Testable |
| 165 | 169 |
| 166 // Raw returns the underlying RawInterface. The Interface and RawInterfa
ce may | 170 // 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 | 171 // be used interchangably; there's no danger of interleaving access to t
he |
| 168 // datastore via the two. | 172 // datastore via the two. |
| 169 Raw() RawInterface | 173 Raw() RawInterface |
| 170 } | 174 } |
| OLD | NEW |