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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // - query is not nil | 131 // - query is not nil |
132 // - cb is not nil | 132 // - cb is not nil |
133 Run(q *FinalizedQuery, cb RawRunCB) error | 133 Run(q *FinalizedQuery, cb RawRunCB) error |
134 | 134 |
135 // Count executes the given query and returns the number of entries whic
h | 135 // Count executes the given query and returns the number of entries whic
h |
136 // match it. | 136 // match it. |
137 Count(q *FinalizedQuery) (int64, error) | 137 Count(q *FinalizedQuery) (int64, error) |
138 | 138 |
139 // GetMulti retrieves items from the datastore. | 139 // GetMulti retrieves items from the datastore. |
140 // | 140 // |
141 » // Callback execues once per key, in the order of keys. Callback may not | 141 » // If there was a server error, it will be returned directly. Otherwise, |
142 » // execute at all if there's a server error. If callback is nil, this | 142 » // callback will execute once per key/value pair, returning either the |
143 » // method does nothing. | 143 » // operation result or individual error for each position. If the callba
ck |
| 144 » // receives an error, it will immediately forward that error and stop |
| 145 » // subsequent callbacks. |
144 // | 146 // |
145 // meta is used to propagate metadata from higher levels. | 147 // meta is used to propagate metadata from higher levels. |
146 // | 148 // |
147 // NOTE: Implementations and filters are guaranteed that: | 149 // NOTE: Implementations and filters are guaranteed that: |
148 // - len(keys) > 0 | 150 // - len(keys) > 0 |
149 // - all keys are Valid, !Incomplete, and in the current namespace | 151 // - all keys are Valid, !Incomplete, and in the current namespace |
150 // - cb is not nil | 152 // - cb is not nil |
151 GetMulti(keys []*Key, meta MultiMetaGetter, cb GetMultiCB) error | 153 GetMulti(keys []*Key, meta MultiMetaGetter, cb GetMultiCB) error |
152 | 154 |
153 // PutMulti writes items to the datastore. | 155 // PutMulti writes items to the datastore. |
154 // | 156 // |
155 » // Callback execues once per key/value pair, in the passed-in order. Cal
lback | 157 » // If there was a server error, it will be returned directly. Otherwise, |
156 » // may not execute at all if there was a server error. | 158 » // callback will execute once per key/value pair, returning either the |
| 159 » // operation result or individual error for each position. If the callba
ck |
| 160 » // receives an error, it will immediately forward that error and stop |
| 161 » // subsequent callbacks. |
157 // | 162 // |
158 // NOTE: Implementations and filters are guaranteed that: | 163 // NOTE: Implementations and filters are guaranteed that: |
159 // - len(keys) > 0 | 164 // - len(keys) > 0 |
160 // - len(keys) == len(vals) | 165 // - len(keys) == len(vals) |
161 // - all keys are Valid and in the current namespace | 166 // - all keys are Valid and in the current namespace |
162 // - cb is not nil | 167 // - cb is not nil |
163 PutMulti(keys []*Key, vals []PropertyMap, cb PutMultiCB) error | 168 PutMulti(keys []*Key, vals []PropertyMap, cb PutMultiCB) error |
164 | 169 |
165 // DeleteMulti removes items from the datastore. | 170 // DeleteMulti removes items from the datastore. |
166 // | 171 // |
167 » // Callback execues once per key, in the order of keys. Callback may not | 172 » // If there was a server error, it will be returned directly. Otherwise, |
168 » // execute at all if there's a server error. | 173 » // callback will execute once per key/value pair, returning either the |
| 174 » // operation result or individual error for each position. If the callba
ck |
| 175 » // receives an error, it will immediately forward that error and stop |
| 176 » // subsequent callbacks. |
169 // | 177 // |
170 // NOTE: Implementations and filters are guaranteed that | 178 // NOTE: Implementations and filters are guaranteed that |
171 // - len(keys) > 0 | 179 // - len(keys) > 0 |
172 // - all keys are Valid, !Incomplete, and in the current namespace | 180 // - all keys are Valid, !Incomplete, and in the current namespace |
173 // - none keys of the keys are 'special' (use a kind prefixed with '__
') | 181 // - none keys of the keys are 'special' (use a kind prefixed with '__
') |
174 // - cb is not nil | 182 // - cb is not nil |
175 DeleteMulti(keys []*Key, cb DeleteMultiCB) error | 183 DeleteMulti(keys []*Key, cb DeleteMultiCB) error |
176 | 184 |
177 // Testable returns the Testable interface for the implementation, or ni
l if | 185 // Testable returns the Testable interface for the implementation, or ni
l if |
178 // there is none. | 186 // there is none. |
179 Testable() Testable | 187 Testable() Testable |
180 } | 188 } |
OLD | NEW |