Crate tauri_plugin_centrifugo

Crate tauri_plugin_centrifugo 

Source
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 communication
  • core: Core Centrifugo client logic and state management
  • models: Data structures for requests, responses, and configuration
  • error: Custom error types and error handling

§Dependencies

  • tokio-centrifugo: Rust client library for Centrifugo
  • serde: Serialization/deserialization
  • thiserror: Error handling utilities
  • futures-util: Async stream utilities

§License

MIT License

Re-exports§

pub use error::Result;

Modules§

commands
Tauri Commands
core
Core Centrifugo Client
error
Error Handling
models
Data Models

Functions§

init
Initialize the Centrifugo plugin for Tauri