Remove non-documentation lint

Because of extensive nature of changes, tested all three non-memstore
backends - passed.
This commit is contained in:
kortschak 2014-08-28 11:51:39 +09:30
parent 6614466d23
commit 484bf145a8
35 changed files with 277 additions and 284 deletions

View file

@ -38,29 +38,28 @@ func NewSession(qs graph.QuadStore) *Session {
return &m
}
func (m *Session) ToggleDebug() {
m.debug = !m.debug
func (s *Session) ToggleDebug() {
s.debug = !s.debug
}
func (m *Session) GetQuery(input string, output_struct chan map[string]interface{}) {
defer close(output_struct)
func (s *Session) GetQuery(input string, out chan map[string]interface{}) {
defer close(out)
var mqlQuery interface{}
err := json.Unmarshal([]byte(input), &mqlQuery)
if err != nil {
return
}
m.currentQuery = NewQuery(m)
m.currentQuery.BuildIteratorTree(mqlQuery)
s.currentQuery = NewQuery(s)
s.currentQuery.BuildIteratorTree(mqlQuery)
output := make(map[string]interface{})
iterator.OutputQueryShapeForIterator(m.currentQuery.it, m.qs, output)
nodes := output["nodes"].([]iterator.Node)
new_nodes := make([]iterator.Node, 0)
for _, n := range nodes {
iterator.OutputQueryShapeForIterator(s.currentQuery.it, s.qs, output)
nodes := make([]iterator.Node, 0)
for _, n := range output["nodes"].([]iterator.Node) {
n.Tags = nil
new_nodes = append(new_nodes, n)
nodes = append(nodes, n)
}
output["nodes"] = new_nodes
output_struct <- output
output["nodes"] = nodes
out <- output
}
func (s *Session) InputParses(input string) (query.ParseResult, error) {
@ -109,7 +108,7 @@ func (s *Session) ToText(result interface{}) string {
r, _ := json.MarshalIndent(s.currentQuery.results, "", " ")
fmt.Println(string(r))
i := 0
for k, _ := range tags {
for k := range tags {
tagKeys[i] = string(k)
i++
}
@ -123,20 +122,19 @@ func (s *Session) ToText(result interface{}) string {
return out
}
func (s *Session) BuildJson(result interface{}) {
func (s *Session) BuildJSON(result interface{}) {
s.currentQuery.treeifyResult(result.(map[string]graph.Value))
}
func (s *Session) GetJson() ([]interface{}, error) {
func (s *Session) GetJSON() ([]interface{}, error) {
s.currentQuery.buildResults()
if s.currentQuery.isError() {
return nil, s.currentQuery.err
} else {
return s.currentQuery.results, nil
}
return s.currentQuery.results, nil
}
func (s *Session) ClearJson() {
func (s *Session) ClearJSON() {
// Since we create a new Query underneath every query, clearing isn't necessary.
return
}