#iot #rabbitmq #module #broker #manager #applications #mqtt

bin+lib sylvia-iot-coremgr

The manager of Sylvia-IoT core modules

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

#609 in HTTP server

Download history 107/week @ 2024-02-15 19/week @ 2024-02-22 11/week @ 2024-02-29 1/week @ 2024-03-14 9/week @ 2024-03-28 377/week @ 2024-04-04

387 downloads per month
Used in sylvia-iot-data

MIT license

1.5MB
36K SLoC

crates.io Documentation CI Coverage Docker License

sylvia-iot-coremgr

The manager of Sylvia-IoT core modules.

This module:

  • Integrate APIs of sylvia-iot-auth and sylvia-iot-broker.
  • Management the underlying brokers for applications and networks. Now we support:
    • AMQP: RabbitMQ
    • MQTT: EMQX
  • Records all POST, PUT, PATCH, DELETE APIs.

Documentation

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

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

use actix_web::{self, App, HttpServer};
use clap::App as ClapApp;
use sylvia_iot_coremgr::{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 coremgr_state = match routes::new_state("/coremgr", &conf).await {
        Err(e) => {
            println!("Error: {}", e);
            return Ok(());
        },
        Ok(state) => state,
    };
    HttpServer::new(move || App::new().service(routes::new_service(&coremgr_state)))
        .bind("0.0.0.0:1080")?
        .run()
        .await
}

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

All-in-one binary

You can use src/bin/sylvia-iot-core.rs as a single binary to run the whole sylvia-iot platform.

Dependencies

~95MB
~2M SLoC