Add basic models

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet
2025-08-20 14:04:08 +02:00
parent b769fa63f7
commit acf875ed33
10 changed files with 225 additions and 0 deletions

28
src/models/runner.rs Normal file
View File

@@ -0,0 +1,28 @@
use std::net::IpAddr;
use serde::{Deserialize, Serialize};
use crate::time::Timestamp;
#[derive(Serialize, Deserialize)]
pub struct Runner {
id: u32,
/// Mycelium public key
pubkey: String,
/// Mycelium address
address: IpAddr,
/// Needs to be set by the runner, usually `runner<runnerid`
topic: String,
/// If this is true, the runner also listens on a local redis queue
local: bool,
crated_at: Timestamp,
updated_at: Timestamp,
}
#[derive(Serialize, Deserialize)]
pub enum RunnerType {
V,
Python,
Osis,
Rust,
}