OLD | NEW |
---|---|
1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
3 // that can be found in the LICENSE file. | 3 // that can be 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 // dst must be one of: | 130 // dst must be one of: |
131 // - *[]S or *[]*S where S is a struct | 131 // - *[]S or *[]*S where S is a struct |
132 // - *[]P or *[]*P where *P is a concrete type implementing | 132 // - *[]P or *[]*P where *P is a concrete type implementing |
133 // PropertyLoadSaver | 133 // PropertyLoadSaver |
134 // - *[]*Key implies a keys-only query. | 134 // - *[]*Key implies a keys-only query. |
135 GetAll(q *Query, dst interface{}) error | 135 GetAll(q *Query, dst interface{}) error |
136 | 136 |
137 // Exists tests if the supplied objects are present in the datastore. | 137 // Exists tests if the supplied objects are present in the datastore. |
138 // | 138 // |
139 // ent must be one of: | 139 // ent must be one of: |
140 » //» - *S where S is a struct | 140 » //» - *S, where S is a struct |
141 » //» - *P where *P is a concrete type implementing PropertyLoadSaver | 141 » //» - *P, where *P is a concrete type implementing PropertyLoadSaver |
142 // - []S or []*S where S is a struct | 142 // - []S or []*S where S is a struct |
143 // - []P or []*P where *P is a concrete type implementing PropertyL oadSaver | 143 // - []P or []*P where *P is a concrete type implementing PropertyL oadSaver |
144 // - []I where i is some interface type. Each element of the slice must | 144 // - []I where i is some interface type. Each element of the slice must |
145 // be non-nil, and its underlying type must be either *S or *P. | 145 // be non-nil, and its underlying type must be either *S or *P. |
iannucci
2016/06/14 00:19:51
commas for these too?
dnj (Google)
2016/06/14 01:49:43
Done.
| |
146 // - *Key, to check a specific key from the datastore. | 146 // - *Key, to check a specific key from the datastore. |
147 // - []*Key, to check a slice of keys from the datastore. | 147 // - []*Key, to check a slice of keys from the datastore. |
148 // | 148 // |
149 // If an error is encountered, the returned error value will depend on t he | 149 // If an error is encountered, the returned error value will depend on t he |
150 // input arguments. If one argument is supplied, the result will be the | 150 // input arguments. If one argument is supplied, the result will be the |
151 // encountered error type. If multiple arguments are supplied, the resul t will | 151 // encountered error type. If multiple arguments are supplied, the resul t will |
152 // be a MultiError whose error index corresponds to the argument in whic h the | 152 // be a MultiError whose error index corresponds to the argument in whic h the |
153 // error was encountered. | 153 // error was encountered. |
154 // | 154 // |
155 // If an ent argument is a slice, its error type will be a MultiError. N ote | 155 // If an ent argument is a slice, its error type will be a MultiError. N ote |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
202 // NOTE: GetMulti is obsolete. The vararg-accepting Get should be used | 202 // NOTE: GetMulti is obsolete. The vararg-accepting Get should be used |
203 // instead. This is left for backwards compatibility, but will be remove d from | 203 // instead. This is left for backwards compatibility, but will be remove d from |
204 // this interface at some point in the future. | 204 // this interface at some point in the future. |
205 GetMulti(dst interface{}) error | 205 GetMulti(dst interface{}) error |
206 | 206 |
207 // Put inserts a single object into the datastore | 207 // Put inserts a single object into the datastore |
208 // | 208 // |
209 // src must be one of: | 209 // src must be one of: |
210 // - *S where S is a struct | 210 // - *S where S is a struct |
211 // - *P where *P is a concrete type implementing PropertyLoadSaver | 211 // - *P where *P is a concrete type implementing PropertyLoadSaver |
212 // IDs will NOT be written back. | |
iannucci
2016/06/14 00:19:51
whoa why? Even if it implements MetaGetterSetter?
dnj (Google)
2016/06/14 01:49:43
oops, that's leftover from when they were structs.
| |
212 // - []S or []*S where S is a struct | 213 // - []S or []*S where S is a struct |
213 // - []P or []*P where *P is a concrete type implementing PropertyL oadSaver | 214 // - []P or []*P where *P is a concrete type implementing PropertyL oadSaver |
214 // - []I where i is some interface type. Each element of the slice must | 215 // - []I where i is some interface type. Each element of the slice must |
iannucci
2016/06/14 00:19:51
and everywhere
dnj (Google)
2016/06/14 01:49:43
Done.
| |
215 // be non-nil, and its underlying type must be either *S or *P. | 216 // be non-nil, and its underlying type must be either *S or *P. |
216 // | 217 // |
217 // A *Key will be extracted from src via KeyForObj. If | 218 // A *Key will be extracted from src via KeyForObj. If |
218 // extractedKey.Incomplete() is true, then Put will write the resolved ( i.e. | 219 // extractedKey.Incomplete() is true, then Put will write the resolved ( i.e. |
219 // automatic datastore-populated) *Key back to src. | 220 // automatic datastore-populated) *Key back to src. |
220 // | 221 // |
221 // If an error is encountered, the returned error value will depend on t he | 222 // If an error is encountered, the returned error value will depend on t he |
222 // input arguments. If one argument is supplied, the result will be the | 223 // input arguments. If one argument is supplied, the result will be the |
223 // encountered error type. If multiple arguments are supplied, the resul t will | 224 // encountered error type. If multiple arguments are supplied, the resul t will |
224 // be a MultiError whose error index corresponds to the argument in whic h the | 225 // be a MultiError whose error index corresponds to the argument in whic h the |
(...skipping 16 matching lines...) Expand all Loading... | |
241 // resolved keys back to the items in src. | 242 // resolved keys back to the items in src. |
242 // | 243 // |
243 // NOTE: PutMulti is obsolete. The vararg-accepting Put should be used | 244 // NOTE: PutMulti is obsolete. The vararg-accepting Put should be used |
244 // instead. This is left for backwards compatibility, but will be remove d from | 245 // instead. This is left for backwards compatibility, but will be remove d from |
245 // this interface at some point in the future. | 246 // this interface at some point in the future. |
246 PutMulti(src interface{}) error | 247 PutMulti(src interface{}) error |
247 | 248 |
248 // Delete removes the supplied entities from the datastore. | 249 // Delete removes the supplied entities from the datastore. |
249 // | 250 // |
250 // ent must be one of: | 251 // ent must be one of: |
251 » //» - *S where S is a struct | 252 » //» - *S, where S is a struct |
252 » //» - *P where *P is a concrete type implementing PropertyLoadSaver | 253 » //» - *P, where *P is a concrete type implementing PropertyLoadSaver |
253 // - []S or []*S where S is a struct | 254 // - []S or []*S where S is a struct |
254 // - []P or []*P where *P is a concrete type implementing PropertyL oadSaver | 255 // - []P or []*P where *P is a concrete type implementing PropertyL oadSaver |
255 // - []I where i is some interface type. Each element of the slice must | 256 // - []I where i is some interface type. Each element of the slice must |
256 // be non-nil, and its underlying type must be either *S or *P. | 257 // be non-nil, and its underlying type must be either *S or *P. |
257 // - *Key, to remove a specific key from the datastore. | 258 // - *Key, to remove a specific key from the datastore. |
258 // - []*Key, to remove a slice of keys from the datastore. | 259 // - []*Key, to remove a slice of keys from the datastore. |
259 // | 260 // |
260 // If an error is encountered, the returned error value will depend on t he | 261 // If an error is encountered, the returned error value will depend on t he |
261 // input arguments. If one argument is supplied, the result will be the | 262 // input arguments. If one argument is supplied, the result will be the |
262 // encountered error type. If multiple arguments are supplied, the resul t will | 263 // encountered error type. If multiple arguments are supplied, the resul t will |
(...skipping 17 matching lines...) Expand all Loading... | |
280 | 281 |
281 // Testable returns the Testable interface for the implementation, or ni l if | 282 // Testable returns the Testable interface for the implementation, or ni l if |
282 // there is none. | 283 // there is none. |
283 Testable() Testable | 284 Testable() Testable |
284 | 285 |
285 // Raw returns the underlying RawInterface. The Interface and RawInterfa ce may | 286 // Raw returns the underlying RawInterface. The Interface and RawInterfa ce may |
286 // be used interchangably; there's no danger of interleaving access to t he | 287 // be used interchangably; there's no danger of interleaving access to t he |
287 // datastore via the two. | 288 // datastore via the two. |
288 Raw() RawInterface | 289 Raw() RawInterface |
289 } | 290 } |
OLD | NEW |