Skip to content

Commit 73ac153

Browse files
committed
go mod redisgraph-go/v2
1 parent f86cee7 commit 73ac153

File tree

5 files changed

+39
-19
lines changed

5 files changed

+39
-19
lines changed

example_graph_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"crypto/tls"
55
"crypto/x509"
66
"fmt"
7-
"github.com/RedisGraph/redisgraph-go"
7+
"github.com/RedisGraph/redisgraph-go/v2"
88
"github.com/gomodule/redigo/redis"
99
"io/ioutil"
1010
"log"

examples/redisgraph_tls_client/redisgraph_tls_client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"crypto/x509"
66
"flag"
77
"fmt"
8-
"github.com/RedisGraph/redisgraph-go"
8+
"github.com/RedisGraph/redisgraph-go/v2"
99
"github.com/gomodule/redigo/redis"
1010
"io/ioutil"
1111
"log"

go.mod

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
module github.com/RedisGraph/redisgraph-go
1+
module github.com/RedisGraph/redisgraph-go/v2
22

3-
go 1.12
3+
go 1.15
44

55
require (
6-
github.com/gomodule/redigo v1.8.2
7-
github.com/olekukonko/tablewriter v0.0.4
8-
github.com/stretchr/testify v1.6.1
6+
github.com/gomodule/redigo v1.8.8
7+
github.com/olekukonko/tablewriter v0.0.5
8+
github.com/stretchr/testify v1.7.0
99
)

go.sum

+8-12
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
22
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3-
github.com/gomodule/redigo v1.8.2 h1:H5XSIre1MB5NbPYFp+i1NBbb5qN1W8Y8YAQoAYbkm8k=
4-
github.com/gomodule/redigo v1.8.2/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0=
5-
github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0=
6-
github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
7-
github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54=
8-
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
9-
github.com/olekukonko/tablewriter v0.0.4 h1:vHD/YYe1Wolo78koG299f7V/VAS08c6IpCLn+Ejf/w8=
10-
github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA=
3+
github.com/gomodule/redigo v1.8.8 h1:f6cXq6RRfiyrOJEV7p3JhLDlmawGBVBBP1MggY8Mo4E=
4+
github.com/gomodule/redigo v1.8.8/go.mod h1:7ArFNvsTjH8GMMzB4uy1snslv2BwmginuMs06a1uzZE=
5+
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
6+
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
7+
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
8+
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
119
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1210
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
1311
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
14-
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
15-
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
16-
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
12+
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
13+
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
1714
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1815
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
19-
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
2016
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
2117
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

graph.go

+24
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,30 @@ func (g *Graph) ROQuery(q string) (*QueryResult, error) {
140140
return QueryResultNew(g, r)
141141
}
142142

143+
// Sent query and an additional WAIT command using pipeline
144+
func (g *Graph) WriteWait(q string, timeout int) (*QueryResult, error) {
145+
c := g.Conn
146+
num_replicas := 1
147+
148+
c.Send("GRAPH.QUERY", g.Id, q, "--compact")
149+
c.Send("WAIT", num_replicas, timeout)
150+
c.Flush()
151+
152+
// reply from GRAPH.QUERY
153+
result_set, err := c.Receive()
154+
if err != nil {
155+
return nil, err
156+
}
157+
158+
// reply from WAIT
159+
_, err = c.Receive()
160+
//if err != nil {
161+
// return nil, err
162+
//}
163+
164+
return QueryResultNew(g, result_set)
165+
}
166+
143167
func (g *Graph) ParameterizedQuery(q string, params map[string]interface{}) (*QueryResult, error) {
144168
if(params != nil){
145169
q = BuildParamsHeader(params) + q

0 commit comments

Comments
 (0)