MCPcopy
hub / github.com/dgraph-io/dgraph / getTypeVal

Function getTypeVal

dgraph/cmd/live/batch.go:185–203  ·  view source on GitHub ↗
(val *api.Value)

Source from the content-addressed store, hash-verified

183}
184
185func getTypeVal(val *api.Value) (types.Val, error) {
186 p := dql.TypeValFrom(val)
187 // Convert value to bytes
188
189 if p.Tid == types.GeoID || p.Tid == types.DateTimeID {
190 // Already in bytes format
191 p.Value = p.Value.([]byte)
192 return p, nil
193 }
194
195 p1 := types.ValueForType(types.BinaryID)
196 if err := types.Marshal(p, &p1); err != nil {
197 return p1, err
198 }
199
200 p1.Value = p1.Value.([]byte)
201 p1.Tid = p.Tid
202 return p1, nil
203}
204
205func createUidEdge(nq *api.NQuad, sid, oid uint64) *pb.DirectedEdge {
206 return &pb.DirectedEdge{

Callers 1

createValueEdgeFunction · 0.85

Calls 3

TypeValFromFunction · 0.92
ValueForTypeFunction · 0.92
MarshalFunction · 0.92

Tested by

no test coverage detected