feat(server/actors): create stub RepoActor

This commit is contained in:
Paul Campbell 2024-04-07 19:41:21 +01:00
parent 3ac4894d68
commit eacefefe20
3 changed files with 25 additions and 0 deletions

1
src/server/actors/mod.rs Normal file
View file

@ -0,0 +1 @@
pub mod repo;

23
src/server/actors/repo.rs Normal file
View file

@ -0,0 +1,23 @@
use actix::prelude::*;
use tracing::info;
use crate::server::config::RepoDetails;
pub struct RepoActor {
pub defailt: RepoDetails,
}
impl Actor for RepoActor {
type Context = Context<Self>;
}
#[derive(Message)]
#[rtype(result = "()")]
pub struct StartRepo;
impl Handler<StartRepo> for RepoActor {
type Result = ();
fn handle(&mut self, _msg: StartRepo, _ctx: &mut Self::Context) -> Self::Result {
info!(
"Starting Repo: {} - {}",
self.defailt.name.0, self.defailt.path.0
);
}
}

View file

@ -1,3 +1,4 @@
mod actors;
mod config;
use std::path::PathBuf;