feature(krata): rework api and make ip assignment persistent to database

This commit is contained in:
Alex Zenla
2024-07-21 01:34:28 -07:00
parent 8616ed7d9b
commit 2c868ce0ca
31 changed files with 773 additions and 4134 deletions

View File

@ -0,0 +1,21 @@
use anyhow::Result;
use redb::Database;
use std::path::Path;
use std::sync::Arc;
pub mod ip;
pub mod zone;
#[derive(Clone)]
pub struct KrataDatabase {
pub database: Arc<Database>,
}
impl KrataDatabase {
pub fn open(path: &Path) -> Result<Self> {
let database = Database::create(path)?;
Ok(KrataDatabase {
database: Arc::new(database),
})
}
}