Expand description
§Tauri Plugin Centrifugo
A Tauri plugin for real-time communication with Centrifugo server using the tokio-centrifuge library.
§Features
- Real-time Communication: WebSocket-based communication with Centrifugo
- JSON & Protobuf Support: Choose between JSON and Protobuf protocols
- Event-driven Architecture: Comprehensive event system for connection state and messages
- Channel Management: Subscribe/unsubscribe to channels dynamically
- Authentication: JWT token support for secure connections
- Cross-platform: Works on desktop and mobile platforms
§Usage
use tauri_plugin_centrifugo::init;
// fn main() {
// tauri::Builder::default()
// .plugin(init())
// .run(tauri::generate_context!())
// .expect("error while running tauri application");
// }§Architecture
The plugin consists of several modules:
commands: Tauri command handlers for frontend communicationcore: Core Centrifugo client logic and state managementmodels: Data structures for requests, responses, and configurationerror: Custom error types and error handling
§Dependencies
tokio-centrifugo: Rust client library for Centrifugoserde: Serialization/deserializationthiserror: Error handling utilitiesfutures-util: Async stream utilities
§License
MIT License
Re-exports§
pub use error::Result;
Modules§
Functions§
- init
- Initialize the Centrifugo plugin for Tauri