MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / FromInt

Function FromInt

task/conversion.go:23–27  ·  view source on GitHub ↗

FromInt converts the given int value into a pb.TaskValue object.

(val int)

Source from the content-addressed store, hash-verified

21
22// FromInt converts the given int value into a pb.TaskValue object.
23func FromInt(val int) *pb.TaskValue {
24 bs := make([]byte, 8)
25 binary.LittleEndian.PutUint64(bs, uint64(val))
26 return &pb.TaskValue{Val: bs, ValType: pb.Posting_INT}
27}
28
29// ToInt converts the given pb.TaskValue object into an integer.
30// Note, this panics if there are not enough bytes in val.Val

Callers 2

TestSubgraphToFastJSONFunction · 0.92
FromBoolFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestSubgraphToFastJSONFunction · 0.74