MCPcopy Create free account
hub / github.com/RedisGraph/redisgraph-go / Encode

Method Encode

edge.go:74–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72}
73
74func (e Edge) Encode() string {
75 s := []string{"(", e.Source.Alias, ")"}
76
77 s = append(s, "-[")
78
79 if e.Relation != "" {
80 s = append(s, ":", e.Relation)
81 }
82
83 if len(e.Properties) > 0 {
84 p := make([]string, 0, len(e.Properties))
85 for k, v := range e.Properties {
86 p = append(p, fmt.Sprintf("%s:%v", k, ToString(v)))
87 }
88
89 s = append(s, "{")
90 s = append(s, strings.Join(p, ","))
91 s = append(s, "}")
92 }
93
94 s = append(s, "]->")
95 s = append(s, "(", e.Destination.Alias, ")")
96
97 return strings.Join(s, "")
98}

Callers

nothing calls this directly

Calls 1

ToStringFunction · 0.85

Tested by

no test coverage detected