From eacefefe201d56dc59eabb4e0cc5aa67e07db23d Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 7 Apr 2024 19:41:21 +0100 Subject: [PATCH] feat(server/actors): create stub RepoActor --- src/server/actors/mod.rs | 1 + src/server/actors/repo.rs | 23 +++++++++++++++++++++++ src/server/mod.rs | 1 + 3 files changed, 25 insertions(+) create mode 100644 src/server/actors/mod.rs create mode 100644 src/server/actors/repo.rs diff --git a/src/server/actors/mod.rs b/src/server/actors/mod.rs new file mode 100644 index 0000000..c426b23 --- /dev/null +++ b/src/server/actors/mod.rs @@ -0,0 +1 @@ +pub mod repo; diff --git a/src/server/actors/repo.rs b/src/server/actors/repo.rs new file mode 100644 index 0000000..abc9732 --- /dev/null +++ b/src/server/actors/repo.rs @@ -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; +} +#[derive(Message)] +#[rtype(result = "()")] +pub struct StartRepo; +impl Handler 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 + ); + } +} diff --git a/src/server/mod.rs b/src/server/mod.rs index 9e1a0ff..9e8054d 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -1,3 +1,4 @@ +mod actors; mod config; use std::path::PathBuf;