Rename TSVal
This commit is contained in:
parent
a1453da84e
commit
d87e227ff3
29 changed files with 118 additions and 118 deletions
|
|
@ -135,7 +135,7 @@ func mapFunc(env *otto.Otto, ses *Session, obj *otto.Object) func(otto.FunctionC
|
|||
}
|
||||
}
|
||||
|
||||
func tagsToValueMap(m map[string]graph.TSVal, ses *Session) map[string]string {
|
||||
func tagsToValueMap(m map[string]graph.Value, ses *Session) map[string]string {
|
||||
outputMap := make(map[string]string)
|
||||
for k, v := range m {
|
||||
outputMap[k] = ses.ts.NameOf(v)
|
||||
|
|
@ -155,7 +155,7 @@ func runIteratorToArray(it graph.Iterator, ses *Session, limit int) []map[string
|
|||
if !ok {
|
||||
break
|
||||
}
|
||||
tags := make(map[string]graph.TSVal)
|
||||
tags := make(map[string]graph.Value)
|
||||
it.TagResults(tags)
|
||||
output = append(output, tagsToValueMap(tags, ses))
|
||||
count++
|
||||
|
|
@ -166,7 +166,7 @@ func runIteratorToArray(it graph.Iterator, ses *Session, limit int) []map[string
|
|||
if ses.doHalt {
|
||||
return nil
|
||||
}
|
||||
tags := make(map[string]graph.TSVal)
|
||||
tags := make(map[string]graph.Value)
|
||||
it.TagResults(tags)
|
||||
output = append(output, tagsToValueMap(tags, ses))
|
||||
count++
|
||||
|
|
@ -212,7 +212,7 @@ func runIteratorWithCallback(it graph.Iterator, ses *Session, callback otto.Valu
|
|||
if !ok {
|
||||
break
|
||||
}
|
||||
tags := make(map[string]graph.TSVal)
|
||||
tags := make(map[string]graph.Value)
|
||||
it.TagResults(tags)
|
||||
val, _ := this.Otto.ToValue(tagsToValueMap(tags, ses))
|
||||
val, _ = callback.Call(this.This, val)
|
||||
|
|
@ -224,7 +224,7 @@ func runIteratorWithCallback(it graph.Iterator, ses *Session, callback otto.Valu
|
|||
if ses.doHalt {
|
||||
return
|
||||
}
|
||||
tags := make(map[string]graph.TSVal)
|
||||
tags := make(map[string]graph.Value)
|
||||
it.TagResults(tags)
|
||||
val, _ := this.Otto.ToValue(tagsToValueMap(tags, ses))
|
||||
val, _ = callback.Call(this.This, val)
|
||||
|
|
@ -253,7 +253,7 @@ func runIteratorOnSession(it graph.Iterator, ses *Session) {
|
|||
if !ok {
|
||||
break
|
||||
}
|
||||
tags := make(map[string]graph.TSVal)
|
||||
tags := make(map[string]graph.Value)
|
||||
it.TagResults(tags)
|
||||
cont := ses.SendResult(&GremlinResult{metaresult: false, err: "", val: nil, actualResults: &tags})
|
||||
if !cont {
|
||||
|
|
@ -263,7 +263,7 @@ func runIteratorOnSession(it graph.Iterator, ses *Session) {
|
|||
if ses.doHalt {
|
||||
return
|
||||
}
|
||||
tags := make(map[string]graph.TSVal)
|
||||
tags := make(map[string]graph.Value)
|
||||
it.TagResults(tags)
|
||||
cont := ses.SendResult(&GremlinResult{metaresult: false, err: "", val: nil, actualResults: &tags})
|
||||
if !cont {
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ type GremlinResult struct {
|
|||
metaresult bool
|
||||
err string
|
||||
val *otto.Value
|
||||
actualResults *map[string]graph.TSVal
|
||||
actualResults *map[string]graph.Value
|
||||
}
|
||||
|
||||
func (s *Session) ToggleDebug() {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import (
|
|||
"github.com/google/cayley/graph"
|
||||
)
|
||||
|
||||
func (q *Query) treeifyResult(tags map[string]graph.TSVal) map[ResultPath]string {
|
||||
func (q *Query) treeifyResult(tags map[string]graph.Value) map[ResultPath]string {
|
||||
// Transform the map into something a little more interesting.
|
||||
results := make(map[Path]string)
|
||||
for k, v := range tags {
|
||||
|
|
|
|||
|
|
@ -92,11 +92,11 @@ func (s *Session) ExecInput(input string, c chan interface{}, limit int) {
|
|||
if !ok {
|
||||
break
|
||||
}
|
||||
tags := make(map[string]graph.TSVal)
|
||||
tags := make(map[string]graph.Value)
|
||||
it.TagResults(tags)
|
||||
c <- tags
|
||||
for it.NextResult() == true {
|
||||
tags := make(map[string]graph.TSVal)
|
||||
tags := make(map[string]graph.Value)
|
||||
it.TagResults(tags)
|
||||
c <- tags
|
||||
}
|
||||
|
|
@ -104,7 +104,7 @@ func (s *Session) ExecInput(input string, c chan interface{}, limit int) {
|
|||
}
|
||||
|
||||
func (s *Session) ToText(result interface{}) string {
|
||||
tags := result.(map[string]graph.TSVal)
|
||||
tags := result.(map[string]graph.Value)
|
||||
out := fmt.Sprintln("****")
|
||||
tagKeys := make([]string, len(tags))
|
||||
s.currentQuery.treeifyResult(tags)
|
||||
|
|
@ -127,7 +127,7 @@ func (s *Session) ToText(result interface{}) string {
|
|||
}
|
||||
|
||||
func (s *Session) BuildJson(result interface{}) {
|
||||
s.currentQuery.treeifyResult(result.(map[string]graph.TSVal))
|
||||
s.currentQuery.treeifyResult(result.(map[string]graph.Value))
|
||||
}
|
||||
|
||||
func (s *Session) GetJson() (interface{}, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue