func (b *Bitcask) List(dir string) string { c_key := C.CString(dir) defer C.free(unsafe.Pointer(c_key)) cstr, _ := C.bc_list(b.bc, c_key, nil) if cstr == nil { return "" } defer C.free(unsafe.Pointer(cstr)) return C.GoString(cstr) }
func (b *Bitcask) ListPrefix(dir, prefix string) string { c_key := C.CString(dir) defer C.free(unsafe.Pointer(c_key)) c_prefix := C.CString(prefix) defer C.free(unsafe.Pointer(c_prefix)) cstr, _ := C.bc_list(b.bc, c_key, c_prefix) if cstr == nil { return "" } defer C.free(unsafe.Pointer(cstr)) return C.GoString(cstr) }