Пример #1
0
// Key returns the current key of the cursor.
func (cur *Cursor) Key() []byte {
	size := C.int(C.sp_keysize(cur.Pointer))
	if 0 == size {
		fmt.Println("Key is 0 len")
		return nil
	}
	return C.GoBytes(unsafe.Pointer(C.sp_key(cur.Pointer)), size)
}
Пример #2
0
// KeySize returns the size of the current key.
func (cur *Cursor) KeySize() int {
	return int(C.sp_keysize(cur.Pointer))
}