#iot #devices #networking #routes #unit #applications #platform

bin+lib sylvia-iot-broker

The message broker module of the Sylvia-IoT platform

35 releases

0.0.36 Feb 16, 2024
0.0.35 Dec 15, 2023
0.0.34 Oct 20, 2023
0.0.20 Jul 28, 2023
0.0.6 Mar 31, 2023

#238 in HTTP server

Download history 110/week @ 2024-02-16 18/week @ 2024-02-23 11/week @ 2024-03-01 5/week @ 2024-03-08 3/week @ 2024-03-15 19/week @ 2024-03-29 358/week @ 2024-04-05

382 downloads per month
Used in 2 crates

MIT license

1MB
21K SLoC

crates.io Documentation CI Coverage Docker License

sylvia-iot-broker

The message broker module of the Sylvia-IoT platform.

This module provides:

  • Unit management for each owner, including
    • Applications
    • Private networks
    • Devices
    • Device routes to applications
    • Private network routes to applications
  • Public network management

Documentation

Mount sylvia-iot-broker in your Actix-Web App

You can simply mount sylvia-iot-broker into your Actix-Web App:

use actix_web::{self, App, HttpServer};
use clap::App as ClapApp;
use sylvia_iot_broker::{libs, routes};

#[tokio::main]
async fn main() -> std::io::Result<()> {
    let args = ClapApp::new("your-project-name").get_matches();

    let conf = libs::config::read_args(&args);
    let broker_state = match routes::new_state("/broker", &conf).await {
        Err(e) => {
            println!("Error: {}", e);
            return Ok(());
        },
        Ok(state) => state,
    };
    HttpServer::new(move || App::new().service(routes::new_service(&broker_state)))
        .bind("0.0.0.0:1080")?
        .run()
        .await
}

Please see src/bin/sylvia-iot-broker.rs to get the real world example.

Dependencies

~85MB
~1.5M SLoC