Compare commits
No commits in common. "60d325e4bf6021ba569ce07ae01b8e81ec6617c5" and "95601570351c88d017d60612d902f781a29a31d3" have entirely different histories.
60d325e4bf
...
9560157035
|
|
@ -1,3 +1,2 @@
|
|||
/target
|
||||
Cargo.lock
|
||||
*.sock
|
||||
Cargo.lock
|
||||
|
|
@ -1,11 +1,15 @@
|
|||
[workspace]
|
||||
resolver = "2"
|
||||
members = [
|
||||
"crates/api-grub", "crates/config-delivery", "crates/integr-structs", "crates/preproc",
|
||||
"crates/api-puller",
|
||||
"crates/snmp-puller",
|
||||
"crates/integr-config",
|
||||
"crates/data-transfer",
|
||||
"crates/integrd",
|
||||
]
|
||||
|
||||
[profile.dev]
|
||||
debug = true
|
||||
|
||||
[profile.test]
|
||||
debug = false
|
||||
debug = false
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
[package]
|
||||
name = "api-grub"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.217", features = ["derive"] }
|
||||
serde_json = "1.0.135"
|
||||
tokio = { version = "1.43.0", features = ["full"] }
|
||||
integr-structs = {path = "../integr-structs"}
|
||||
env_logger = "0.11.6"
|
||||
log = "0.4.25"
|
||||
anyhow = "1.0.95"
|
||||
chrono = "0.4.39"
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"api-endpoint" : "http://127.0.0.1:8081/ping",
|
||||
"method" : "GET",
|
||||
"delay" : "5"
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
// mod to communicate with api-grub config file
|
||||
// 1) check changes in unix-socket
|
||||
// 2) save changes in local config file
|
||||
use integr_structs::api::ApiConfig;
|
||||
use tokio::net::UnixListener;
|
||||
use anyhow::Result;
|
||||
|
||||
// for config pulling
|
||||
async fn init_api_grub_mechanism(config: ApiConfig) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
async fn init_unix_listener() {}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
use chrono::Local;
|
||||
use env_logger::Builder;
|
||||
use log::LevelFilter;
|
||||
use std::io::Write;
|
||||
use anyhow::Result;
|
||||
|
||||
pub fn setup_logger() -> Result<()> {
|
||||
Builder::new()
|
||||
.format(move |buf, record| {
|
||||
writeln!(
|
||||
buf,
|
||||
"|{}| {} [{}] - {}",
|
||||
"api-grubber",
|
||||
Local::now().format("%d-%m-%Y %H:%M:%S"),
|
||||
record.level(),
|
||||
record.args(),
|
||||
)
|
||||
})
|
||||
.filter(None, LevelFilter::Info)
|
||||
.target(env_logger::Target::Stdout)
|
||||
.init();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
mod config;
|
||||
mod net;
|
||||
mod logger;
|
||||
|
||||
use anyhow::Result;
|
||||
use logger::setup_logger;
|
||||
use log::info;
|
||||
|
||||
#[tokio::main(flavor = "multi_thread")]
|
||||
async fn main() -> Result<()>{
|
||||
// 3 coroutines
|
||||
// 1) unix-socket coroutine (for config updating)
|
||||
// 2) api coroutine
|
||||
// 3) ?
|
||||
setup_logger()?;
|
||||
info!("Logger configured");
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
// module to handle unix-socket connection + pulling info from api
|
||||
use anyhow;
|
||||
|
||||
|
||||
// for api info pulling
|
||||
async fn init_api_grub_mechanism() {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "config-delivery"
|
||||
name = "api-puller"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
[package]
|
||||
name = "data-transfer"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
[package]
|
||||
name = "integr-config"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
[package]
|
||||
name = "integr-structs"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.217", features = ["derive"] }
|
||||
serde_json = "1.0.135"
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
use serde::{Serialize, Deserialize};
|
||||
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct ApiConfig {
|
||||
url : String,
|
||||
method : String,
|
||||
delay : u32,
|
||||
}
|
||||
|
||||
|
||||
impl Default for ApiConfig {
|
||||
fn default() -> Self {
|
||||
ApiConfig {
|
||||
url : String::new(),
|
||||
method : String::new(),
|
||||
delay : 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
pub mod api;
|
||||
pub mod preproc;
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "preproc"
|
||||
name = "integrd"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
[package]
|
||||
name = "snmp-puller"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
Loading…
Reference in New Issue