package nosqldb_sdk import ( "C" ) import ( "fmt" "time" "unsafe" "github.com/oracle/nosql-go-sdk/nosqldb" "nosql_db_sdk_ffi/util/ptrproxy" ) //export ffi_nosqldb_table_result_wait_for_completion func ffi_nosqldb_table_result_wait_for_completion(unsafe_nosqldb_table_result_ptr NosqldbTableResult, unsafe_nosqldb_client_ptr NosqldbClient, timeout, poll_interval C.uint) (NosqldbTableResult, Error) { nosqldb_table_result_ptr, ok := ptrproxy.Move(unsafe.Pointer(unsafe_nosqldb_table_result_ptr)) if !ok { return nil, C.CString("NosqldbTableResultPtr cannot deref") } table_result := (*nosqldb.TableResult)(nosqldb_table_result_ptr) nosqldb_client_ptr, ok := ptrproxy.Deref(unsafe.Pointer(unsafe_nosqldb_client_ptr)) if !ok { return nil, C.CString("NosqldbClientPtr cannot deref") } client := (*nosqldb.Client)(nosqldb_client_ptr) tres, err := table_result.WaitForCompletion(client, time.Duration(timeout)*time.Second, time.Duration(poll_interval)*time.Second) if err != nil { return nil, C.CString(err.Error()) } return NosqldbTableResult(ptrproxy.Ref(unsafe.Pointer(tres))), nil } //export ffi_nosqldb_table_result_debug func ffi_nosqldb_table_result_debug(unsafe_nosqldb_table_result_ptr NosqldbTableResult) Error { nosqldb_table_result_ptr, ok := ptrproxy.Deref(unsafe.Pointer(unsafe_nosqldb_table_result_ptr)) if !ok { return C.CString("NosqldbClientPtr cannot deref") } tres := (*nosqldb.TableResult)(nosqldb_table_result_ptr) fmt.Printf("table_result: %v\n", tres) return nil } //export ffi_nosqldb_delete_result_get_success func ffi_nosqldb_delete_result_get_success(unsafe_nosqldb_delete_result_ptr NosqldbDeleteResult) (bool, Error) { nosqldb_delete_result_ptr, ok := ptrproxy.Deref(unsafe.Pointer(unsafe_nosqldb_delete_result_ptr)) if !ok { return false, C.CString("NosqldbDeleteResultPtr cannot deref") } dltrs := (*nosqldb.DeleteResult)(nosqldb_delete_result_ptr) return dltrs.Success, nil } //export ffi_nosqldb_delete_result_debug func ffi_nosqldb_delete_result_debug(unsafe_nosqldb_delete_result_ptr NosqldbDeleteResult) Error { nosqldb_delete_result_ptr, ok := ptrproxy.Deref(unsafe.Pointer(unsafe_nosqldb_delete_result_ptr)) if !ok { return C.CString("NosqldbDeleteResultPtr cannot deref") } dltrs := (*nosqldb.DeleteResult)(nosqldb_delete_result_ptr) fmt.Printf("delete_table_result: %v\n", dltrs) return nil }