示例#1
0
// SeekGE ...
func (curs *Cursor) SeekGE(key []byte) (err error) {
	res := C.unqlite_kv_cursor_seek(curs.handle, unsafe.Pointer(&key[0]), C.int(len(key)), C.UNQLITE_CURSOR_MATCH_GE)
	if res != C.UNQLITE_OK {
		err = UnQLiteError(res)
	}
	return
}
示例#2
0
func (c *Cursor) Seek(key []byte, iPos int) error {
	var k unsafe.Pointer
	if len(key) > 0 {
		k = unsafe.Pointer(&key[0])
	}
	e := C.unqlite_kv_cursor_seek(c.c, k, C.int(len(key)), C.int(iPos))
	return code2Error(e)
}
示例#3
0
// Seek ...
func (curs *Cursor) Seek(key []byte) (err error) {
	var k unsafe.Pointer

	if len(key) > 0 {
		k = unsafe.Pointer(&key[0])
	}

	res := C.unqlite_kv_cursor_seek(curs.handle, k, C.int(len(key)), C.UNQLITE_CURSOR_MATCH_EXACT)
	if res != C.UNQLITE_OK {
		err = UnQLiteError(res)
	}
	return
}