Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dgraph
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
dgraph
Commits
f551b017
Commit
f551b017
authored
9 years ago
by
Pawan Rawal
Browse files
Options
Downloads
Patches
Plain Diff
Changing query so that response fits size of byte slice
parent
24f03fda
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/go/main.go
+11
-22
11 additions, 22 deletions
client/go/main.go
with
11 additions
and
22 deletions
client/go/main.go
+
11
−
22
View file @
f551b017
...
...
@@ -19,6 +19,7 @@ package main
import
(
"bytes"
"flag"
"fmt"
"net"
"github.com/dgraph-io/dgraph/query/protocolbuffer"
...
...
@@ -34,28 +35,12 @@ func main() {
// TODO(pawan) - Remove hardcoded query. Give helper methods to user for building query.
var
q0
=
`{
me(_xid_: m.06pj8) {
type.object.name.en
film.director.film {
type.object.name.en
film.film.starring {
film.performance.character {
type.object.name.en
}
film.performance.actor {
type.object.name.en
film.director.film {
type.object.name.en
}
}
}
film.film.initial_release_date
film.film.country
film.film.genre {
type.object.name.en
}
}
me(_xid_: m.0f4vbz) {
type.object.name.en
film.actor.film {
type.object.name.en
}
}
}`
// TODO(pawan): Pick address for server from config
...
...
@@ -70,11 +55,12 @@ func main() {
}
// TODO(pawan): Discuss and implement a better way of doing this.
reply
:=
make
([]
byte
,
4096
)
reply
:=
make
([]
byte
,
32768
)
_
,
err
=
conn
.
Read
(
reply
)
if
err
!=
nil
{
x
.
Err
(
glog
,
err
)
.
Fatal
(
"Error in reading response from server"
)
}
// Trimming null bytes
reply
=
bytes
.
Trim
(
reply
,
"
\0
00"
)
...
...
@@ -83,5 +69,8 @@ func main() {
x
.
Err
(
glog
,
err
)
.
Fatal
(
"Error in umarshalling protocol buffer"
)
}
// TODO(pawan): Remove this later
fmt
.
Printf
(
"Subgraph %+v"
,
usg
)
conn
.
Close
()
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment