Skip to content

Commit d96251a

Browse files
committed
api: update iproto.Arrow constants
Closes #412
1 parent d4b5d04 commit d96251a

File tree

4 files changed

+6
-28
lines changed

4 files changed

+6
-28
lines changed

arrow/request.go

+2-14
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@ import (
99
"github.com/vmihailenco/msgpack/v5"
1010
)
1111

12-
// INSERT Arrow request.
13-
//
14-
// FIXME: replace with iproto.IPROTO_INSERT_ARROW when iproto will released.
15-
// https://github.com/tarantool/go-tarantool/issues/412
16-
const iprotoInsertArrowType = iproto.Type(17)
17-
18-
// The data in Arrow format.
19-
//
20-
// FIXME: replace with iproto.IPROTO_ARROW when iproto will released.
21-
// https://github.com/tarantool/go-tarantool/issues/412
22-
const iprotoArrowKey = iproto.Key(0x36)
23-
2412
// InsertRequest helps you to create an insert request object for execution
2513
// by a Connection.
2614
type InsertRequest struct {
@@ -39,7 +27,7 @@ func NewInsertRequest(space interface{}, arrow Arrow) *InsertRequest {
3927

4028
// Type returns a IPROTO_INSERT_ARROW type for the request.
4129
func (r *InsertRequest) Type() iproto.Type {
42-
return iprotoInsertArrowType
30+
return iproto.IPROTO_INSERT_ARROW
4331
}
4432

4533
// Async returns false to the request return a response.
@@ -78,7 +66,7 @@ func (r *InsertRequest) Body(res tarantool.SchemaResolver, enc *msgpack.Encoder)
7866
if err := tarantool.EncodeSpace(res, enc, r.space); err != nil {
7967
return err
8068
}
81-
if err := enc.EncodeUint(uint64(iprotoArrowKey)); err != nil {
69+
if err := enc.EncodeUint(uint64(iproto.IPROTO_ARROW)); err != nil {
8270
return err
8371
}
8472
return enc.Encode(r.arrow)

arrow/request_test.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,11 @@ import (
1313
"github.com/vmihailenco/msgpack/v5"
1414
)
1515

16-
// INSERT Arrow request.
17-
//
18-
// FIXME: replace with iproto.IPROTO_INSERT_ARROW when iproto will released.
19-
// https://github.com/tarantool/go-tarantool/issues/412
20-
const iprotoInsertArrowType = iproto.Type(17)
21-
2216
const validSpace uint32 = 1 // Any valid value != default.
2317

2418
func TestInsertRequestType(t *testing.T) {
2519
request := arrow.NewInsertRequest(validSpace, arrow.Arrow{})
26-
require.Equal(t, iprotoInsertArrowType, request.Type())
20+
require.Equal(t, iproto.IPROTO_INSERT_ARROW, request.Type())
2721
}
2822

2923
func TestInsertRequestAsync(t *testing.T) {

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/google/uuid v1.3.0
77
github.com/shopspring/decimal v1.3.1
88
github.com/stretchr/testify v1.9.0
9-
github.com/tarantool/go-iproto v1.0.0
9+
github.com/tarantool/go-iproto v1.0.1-0.20241010173538-44b6566ef267
1010
github.com/vmihailenco/msgpack/v5 v5.3.5
1111
)
1212

go.sum

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
21
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
32
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
43
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -10,19 +9,16 @@ github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5g
109
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
1110
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
1211
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
13-
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
14-
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
1512
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
1613
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
17-
github.com/tarantool/go-iproto v1.0.0 h1:quC4hdFhCuFYaCqOFgUxH2foRkhAy+TlEy7gQLhdVjw=
18-
github.com/tarantool/go-iproto v1.0.0/go.mod h1:LNCtdyZxojUed8SbOiYHoc3v9NvaZTB7p96hUySMlIo=
14+
github.com/tarantool/go-iproto v1.0.1-0.20241010173538-44b6566ef267 h1:GenzvYfP9io9aEdZFmnopfcBOXmJg6MgBWyd4t8z4oI=
15+
github.com/tarantool/go-iproto v1.0.1-0.20241010173538-44b6566ef267/go.mod h1:LNCtdyZxojUed8SbOiYHoc3v9NvaZTB7p96hUySMlIo=
1916
github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU=
2017
github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc=
2118
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
2219
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
2320
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
2421
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
25-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
2622
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2723
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
2824
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)