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