@@ -19,11 +19,13 @@ type Future struct {
19
19
}
20
20
21
21
// Ping sends empty request to Tarantool to check connection.
22
+ //nolint: errcheck
22
23
func (conn * Connection ) Ping () (resp * Response , err error ) {
23
24
future := conn .newFuture (PingRequest )
24
25
return future .send (conn , func (enc * msgpack.Encoder ) error { enc .EncodeMapLen (0 ); return nil }).Get ()
25
26
}
26
27
28
+ //nolint: errcheck
27
29
func (req * Future ) fillSearch (enc * msgpack.Encoder , spaceNo , indexNo uint32 , key interface {}) error {
28
30
enc .EncodeUint64 (KeySpaceNo )
29
31
enc .EncodeUint64 (uint64 (spaceNo ))
@@ -33,6 +35,7 @@ func (req *Future) fillSearch(enc *msgpack.Encoder, spaceNo, indexNo uint32, key
33
35
return enc .Encode (key )
34
36
}
35
37
38
+ //nolint: errcheck
36
39
func (req * Future ) fillIterator (enc * msgpack.Encoder , offset , limit , iterator uint32 ) {
37
40
enc .EncodeUint64 (KeyIterator )
38
41
enc .EncodeUint64 (uint64 (iterator ))
@@ -42,6 +45,7 @@ func (req *Future) fillIterator(enc *msgpack.Encoder, offset, limit, iterator ui
42
45
enc .EncodeUint64 (uint64 (limit ))
43
46
}
44
47
48
+ //nolint: errcheck
45
49
func (req * Future ) fillInsert (enc * msgpack.Encoder , spaceNo uint32 , tuple interface {}) error {
46
50
enc .EncodeUint64 (KeySpaceNo )
47
51
enc .EncodeUint64 (uint64 (spaceNo ))
@@ -219,6 +223,7 @@ func (conn *Connection) SelectAsync(space, index interface{}, offset, limit, ite
219
223
if err != nil {
220
224
return future .fail (conn , err )
221
225
}
226
+ //nolint: errcheck
222
227
return future .send (conn , func (enc * msgpack.Encoder ) error {
223
228
enc .EncodeMapLen (6 )
224
229
future .fillIterator (enc , offset , limit , iterator )
@@ -234,6 +239,7 @@ func (conn *Connection) InsertAsync(space interface{}, tuple interface{}) *Futur
234
239
if err != nil {
235
240
return future .fail (conn , err )
236
241
}
242
+ //nolint: errcheck
237
243
return future .send (conn , func (enc * msgpack.Encoder ) error {
238
244
enc .EncodeMapLen (2 )
239
245
return future .fillInsert (enc , spaceNo , tuple )
@@ -248,6 +254,7 @@ func (conn *Connection) ReplaceAsync(space interface{}, tuple interface{}) *Futu
248
254
if err != nil {
249
255
return future .fail (conn , err )
250
256
}
257
+ //nolint: errcheck
251
258
return future .send (conn , func (enc * msgpack.Encoder ) error {
252
259
enc .EncodeMapLen (2 )
253
260
return future .fillInsert (enc , spaceNo , tuple )
@@ -256,6 +263,7 @@ func (conn *Connection) ReplaceAsync(space interface{}, tuple interface{}) *Futu
256
263
257
264
// DeleteAsync sends deletion action to tarantool and returns Future.
258
265
// Future's result will contain array with deleted tuple.
266
+ //nolint: errcheck
259
267
func (conn * Connection ) DeleteAsync (space , index interface {}, key interface {}) * Future {
260
268
future := conn .newFuture (DeleteRequest )
261
269
spaceNo , indexNo , err := conn .Schema .resolveSpaceIndex (space , index )
@@ -276,6 +284,7 @@ func (conn *Connection) UpdateAsync(space, index interface{}, key, ops interface
276
284
if err != nil {
277
285
return future .fail (conn , err )
278
286
}
287
+ //nolint: errcheck
279
288
return future .send (conn , func (enc * msgpack.Encoder ) error {
280
289
enc .EncodeMapLen (4 )
281
290
if err := future .fillSearch (enc , spaceNo , indexNo , key ); err != nil {
@@ -294,6 +303,7 @@ func (conn *Connection) UpsertAsync(space interface{}, tuple interface{}, ops in
294
303
if err != nil {
295
304
return future .fail (conn , err )
296
305
}
306
+ //nolint: errcheck
297
307
return future .send (conn , func (enc * msgpack.Encoder ) error {
298
308
enc .EncodeMapLen (3 )
299
309
enc .EncodeUint64 (KeySpaceNo )
@@ -309,6 +319,7 @@ func (conn *Connection) UpsertAsync(space interface{}, tuple interface{}, ops in
309
319
310
320
// CallAsync sends a call to registered tarantool function and returns Future.
311
321
// It uses request code for tarantool 1.6, so future's result is always array of arrays
322
+ //nolint: errcheck
312
323
func (conn * Connection ) CallAsync (functionName string , args interface {}) * Future {
313
324
future := conn .newFuture (CallRequest )
314
325
return future .send (conn , func (enc * msgpack.Encoder ) error {
@@ -325,6 +336,7 @@ func (conn *Connection) CallAsync(functionName string, args interface{}) *Future
325
336
// (though, keep in mind, result is always array)
326
337
func (conn * Connection ) Call17Async (functionName string , args interface {}) * Future {
327
338
future := conn .newFuture (Call17Request )
339
+ //nolint: errcheck
328
340
return future .send (conn , func (enc * msgpack.Encoder ) error {
329
341
enc .EncodeMapLen (2 )
330
342
enc .EncodeUint64 (KeyFunctionName )
@@ -337,6 +349,7 @@ func (conn *Connection) Call17Async(functionName string, args interface{}) *Futu
337
349
// EvalAsync sends a lua expression for evaluation and returns Future.
338
350
func (conn * Connection ) EvalAsync (expr string , args interface {}) * Future {
339
351
future := conn .newFuture (EvalRequest )
352
+ //nolint: errcheck
340
353
return future .send (conn , func (enc * msgpack.Encoder ) error {
341
354
enc .EncodeMapLen (2 )
342
355
enc .EncodeUint64 (KeyExpression )
@@ -350,6 +363,7 @@ func (conn *Connection) EvalAsync(expr string, args interface{}) *Future {
350
363
// private
351
364
//
352
365
366
+ //nolint: errcheck
353
367
func (fut * Future ) pack (h * smallWBuf , enc * msgpack.Encoder , body func (* msgpack.Encoder ) error ) (err error ) {
354
368
rid := fut .requestId
355
369
hl := h .Len ()
0 commit comments