MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _JsonEncoder_GraphEntity

Function _JsonEncoder_GraphEntity

src/util/json_encoder.c:92–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92static sds _JsonEncoder_GraphEntity(GraphEntity *ge, sds s, GraphEntityType type) {
93 switch(type) {
94 case GETYPE_NODE:
95 s = sdscat(s, "{\"type\": \"node\", ");
96 s = _JsonEncoder_Node((const Node *)ge, s);
97 break;
98 case GETYPE_EDGE:
99 s = sdscat(s, "{\"type\": \"relationship\", ");
100 s = _JsonEncoder_Edge((Edge *)ge, s);
101 break;
102 default:
103 ASSERT(false);
104 }
105 s = sdscat(s, "}");
106 return s;
107}
108
109static sds _JsonEncoder_Path(SIValue p, sds s) {
110 // open path with "["

Callers 2

_JsonEncoder_PathFunction · 0.85
_JsonEncoder_SIValueFunction · 0.85

Calls 3

sdscatFunction · 0.85
_JsonEncoder_NodeFunction · 0.85
_JsonEncoder_EdgeFunction · 0.85

Tested by

no test coverage detected