Exemple #1
0
func (r *rocksDBIterator) ValueProto(msg gogoproto.Message) error {
	result := C.DBIterValue(r.iter)
	if result.len <= 0 {
		return nil
	}
	// Make a byte slice that is backed by result.data. This slice
	// cannot live past the lifetime of this method, but we're only
	// using it to unmarshal the proto.
	data := cSliceToUnsafeGoBytes(result)
	return gogoproto.Unmarshal(data, msg)
}
Exemple #2
0
func (r *rocksDBIterator) Value() []byte {
	data := C.DBIterValue(r.iter)
	return cSliceToGoBytes(data)
}