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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 | 111 |
| 112 // GetAll retrieves all of the Query results into dst. | 112 // GetAll retrieves all of the Query results into dst. |
| 113 // | 113 // |
| 114 // dst must be one of: | 114 // dst must be one of: |
| 115 // - *[]S or *[]*S where S is a struct | 115 // - *[]S or *[]*S where S is a struct |
| 116 // - *[]P or *[]*P where *P is a concrete type implementing | 116 // - *[]P or *[]*P where *P is a concrete type implementing |
| 117 // PropertyLoadSaver | 117 // PropertyLoadSaver |
| 118 // - *[]*Key implies a keys-only query. | 118 // - *[]*Key implies a keys-only query. |
| 119 GetAll(q *Query, dst interface{}) error | 119 GetAll(q *Query, dst interface{}) error |
| 120 | 120 |
| 121 // Does a Get for this key and returns true iff it exists. Will only ret urn | |
|
Vadim Sh.
2015/10/13 04:05:57
Exists does a get ... Also explain why it is bette
| |
| 122 // an error if it's not ErrNoSuchEntity | |
| 123 Exists(k *Key) (bool, error) | |
| 124 | |
| 125 // Does a GetMulti for thes keys and returns true iff they exist. Will o nly | |
| 126 // return an error if it's not ErrNoSuchEntity | |
| 127 ExistsMulti(k []*Key) ([]bool, error) | |
|
Vadim Sh.
2015/10/13 04:05:57
same here
| |
| 128 | |
| 121 // Get retrieves a single object from the datastore | 129 // Get retrieves a single object from the datastore |
| 122 // | 130 // |
| 123 // dst must be one of: | 131 // dst must be one of: |
| 124 // - *S where S is a struct | 132 // - *S where S is a struct |
| 125 // - *P where *P is a concrete type implementing PropertyLoadSaver | 133 // - *P where *P is a concrete type implementing PropertyLoadSaver |
| 126 Get(dst interface{}) error | 134 Get(dst interface{}) error |
| 127 | 135 |
| 128 // Put inserts a single object into the datastore | 136 // Put inserts a single object into the datastore |
| 129 // | 137 // |
| 130 // src must be one of: | 138 // src must be one of: |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 | 173 |
| 166 // 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 |
| 167 // there is none. | 175 // there is none. |
| 168 Testable() Testable | 176 Testable() Testable |
| 169 | 177 |
| 170 // Raw returns the underlying RawInterface. The Interface and RawInterfa ce may | 178 // Raw returns the underlying RawInterface. The Interface and RawInterfa ce may |
| 171 // be used interchangably; there's no danger of interleaving access to t he | 179 // be used interchangably; there's no danger of interleaving access to t he |
| 172 // datastore via the two. | 180 // datastore via the two. |
| 173 Raw() RawInterface | 181 Raw() RawInterface |
| 174 } | 182 } |
| OLD | NEW |