Merge branch 'main' of https://github.com/Tensamin/Iota
# Conflicts: # Cargo.lock # Cargo.toml # src/auth/auth_connector.rs # src/main.rs # src/omikron/omikron_connection.rs
This commit is contained in:
commit
3d7ae99eef
7 changed files with 549 additions and 74 deletions
37
src/main.rs
37
src/main.rs
|
|
@ -1,45 +1,44 @@
|
|||
use tokio::runtime::Runtime;
|
||||
use std::process::{Command, ExitStatus};
|
||||
use json::{
|
||||
self
|
||||
};
|
||||
use futures_util::SinkExt;
|
||||
use json::{self};
|
||||
use uuid::Uuid;
|
||||
|
||||
mod data;
|
||||
mod omikron;
|
||||
mod util;
|
||||
mod users;
|
||||
mod gui {
|
||||
pub mod ratatui_interface;
|
||||
}
|
||||
mod auth;
|
||||
|
||||
use crate::auth::auth_connector::AuthConnector;
|
||||
use crate::omikron::omikron_connection::{OmikronConnection};
|
||||
use crate::data::communication::{CommunicationValue, CommunicationType, DataTypes};
|
||||
use gui::{ratatui_interface};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
let alois = AuthConnector::get_uuid("aloisianer").await;
|
||||
if alois.is_none() {
|
||||
println!("No UUID");
|
||||
return
|
||||
}
|
||||
println!("{}", alois.unwrap());
|
||||
let omikron = OmikronConnection::new();
|
||||
let mut omikron: OmikronConnection = OmikronConnection::new();
|
||||
|
||||
omikron.connect().await;
|
||||
|
||||
OmikronConnection::send_message_static(
|
||||
&omikron.writer,
|
||||
omikron.send_message(
|
||||
CommunicationValue::new(
|
||||
CommunicationType::Identification
|
||||
)
|
||||
.add_data(DataTypes::UserIds, Uuid::new_v4().to_string())
|
||||
.add_data(DataTypes::IotaId, Uuid::new_v4().to_string())
|
||||
.add_data(DataTypes::UserIds, json::JsonValue::String(Uuid::new_v4().to_string()))
|
||||
.add_data(DataTypes::IotaId, json::JsonValue::String(Uuid::new_v4().to_string()))
|
||||
.to_json()
|
||||
.to_string()
|
||||
.as_mut().parse().unwrap()
|
||||
.as_mut()
|
||||
.to_string()
|
||||
).await;
|
||||
|
||||
|
||||
omikron.close().await;
|
||||
|
||||
|
||||
let mut child = Command::new("sleep").arg("2").spawn().unwrap();
|
||||
let _result = child.wait().unwrap();
|
||||
|
||||
|
||||
println!("reached end of main");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue