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

Function toInt

dgraph/cmd/debug/run.go:111–124  ·  view source on GitHub ↗
(o *pb.Posting)

Source from the content-addressed store, hash-verified

109}
110
111func toInt(o *pb.Posting) int {
112 from := types.Val{
113 Tid: types.TypeID(o.ValType),
114 Value: o.Value,
115 }
116 out, err := types.Convert(from, types.StringID)
117 x.Check(err)
118 val := out.Value.(string)
119 a, err := strconv.Atoi(val)
120 if err != nil {
121 return 0
122 }
123 return a
124}
125
126func uidToVal(itr *badger.Iterator, prefix string) map[uint64]int {
127 keys := make(map[uint64]int)

Callers 1

showAllPostingsAtFunction · 0.85

Calls 3

TypeIDTypeAlias · 0.92
ConvertFunction · 0.92
CheckFunction · 0.92

Tested by

no test coverage detected