Move iterators into separate package

Also reduce API exposure and use standard library more - and fix bugs I
previously introduces in mongo.
This commit is contained in:
kortschak 2014-06-30 22:22:50 +09:30
parent 88be6bee37
commit 1768e593a8
62 changed files with 3240 additions and 3130 deletions

View file

@ -22,6 +22,7 @@ import (
"github.com/barakmich/glog"
"github.com/google/cayley/graph"
"github.com/google/cayley/graph/iterator"
)
type Session struct {
@ -50,9 +51,9 @@ func (m *Session) GetQuery(input string, output_struct chan map[string]interface
m.currentQuery = NewQuery(m)
m.currentQuery.BuildIteratorTree(mqlQuery)
output := make(map[string]interface{})
graph.OutputQueryShapeForIterator(m.currentQuery.it, m.ts, &output)
nodes := output["nodes"].([]graph.Node)
new_nodes := make([]graph.Node, 0)
iterator.OutputQueryShapeForIterator(m.currentQuery.it, m.ts, &output)
nodes := output["nodes"].([]iterator.Node)
new_nodes := make([]iterator.Node, 0)
for _, n := range nodes {
n.Tags = nil
new_nodes = append(new_nodes, n)