コード例 #1
0
ファイル: Cursor.go プロジェクト: teodor-pripoae/gophia
// 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
ファイル: Cursor.go プロジェクト: teodor-pripoae/gophia
// KeySize returns the size of the current key.
func (cur *Cursor) KeySize() int {
	return int(C.sp_keysize(cur.Pointer))
}