Skip to main content

tauri_plugin_mongoose/
lib.rs

1use tauri::{
2    plugin::{Builder, TauriPlugin},
3    Runtime,
4};
5
6mod commands;
7pub mod db;
8
9pub use db::{
10    connect_to_db, create_document, create_user, find_documents, find_one_document, get_all_users,
11    get_client, get_db_name, get_document_by_id, get_file_url, get_user_by_name, is_connected,
12    save_file, set_db_name, SaveFileRequest,
13};
14
15pub fn init<R: Runtime>() -> TauriPlugin<R> {
16    Builder::new("mongoose")
17        .invoke_handler(tauri::generate_handler![
18            commands::connect,
19            commands::create,
20            commands::get_by_id,
21            commands::get_users,
22            commands::get_user,
23            commands::create_db_user,
24            commands::find,
25            commands::find_one,
26            commands::update_one,
27            commands::save_file,
28            commands::get_file_url
29        ])
30        .build()
31}