refactos: extract server-actor crate

This commit is contained in:
Paul Campbell 2024-06-29 11:14:09 +01:00
parent 52d442f2b0
commit 113192042b
8 changed files with 45 additions and 18 deletions

View file

@ -3,6 +3,7 @@ resolver = "2"
members = [
"crates/cli",
"crates/server",
"crates/server-actor",
"crates/config",
"crates/git",
"crates/forge",
@ -26,6 +27,7 @@ expect_used = "warn"
[workspace.dependencies]
git-next-server = { path = "crates/server" }
git-next-server-actor = { path = "crates/server-actor" }
git-next-config = { path = "crates/config" }
git-next-git = { path = "crates/git" }
git-next-forge = { path = "crates/forge" }

View file

@ -4,7 +4,8 @@ version = { workspace = true }
edition = { workspace = true }
[dependencies]
# git-next-config = { workspace = true }
git-next-config = { workspace = true }
git-next-actor-macros = { workspace = true }
# git-next-repo-actor = { workspace = true }
# logging

View file

@ -0,0 +1,35 @@
[package]
name = "git-next-server-actor"
version = { workspace = true }
edition = { workspace = true }
[dependencies]
git-next-config = { workspace = true }
git-next-git = { workspace = true }
git-next-forge = { workspace = true }
git-next-repo-actor = { workspace = true }
git-next-actor-macros = { workspace = true }
git-next-file-watcher-actor = { workspace = true }
git-next-webhook-actor = { workspace = true }
# logging
tracing = { workspace = true }
# fs/network
kxio = { workspace = true }
# boilerplate
derive_more = { workspace = true }
# Actors
actix = { workspace = true }
[dev-dependencies]
# Testing
# assert2 = { workspace = true }
[lints.clippy]
nursery = { level = "warn", priority = -1 }
# pedantic = "warn"
unwrap_used = "warn"
expect_used = "warn"

View file

@ -1,12 +1,11 @@
//
use actix::prelude::*;
use config::server::{ServerConfig, ServerStorage, Webhook};
use config::{ForgeAlias, ForgeConfig, GitDir, RepoAlias, ServerRepoConfig};
use git::{repository::RepositoryFactory, Generation, RepoDetails};
use git_next_actor_macros::message;
use git_next_config as config;
use git_next_config::server::{ServerConfig, ServerStorage, Webhook};
use git_next_config::{ForgeAlias, ForgeConfig, GitDir, RepoAlias, ServerRepoConfig};
use git_next_file_watcher_actor::FileUpdated;
use git_next_git as git;
use git_next_git::{repository::RepositoryFactory, Generation, RepoDetails};
use git_next_repo_actor::{messages::CloneRepo, RepoActor};
use git_next_webhook_actor as webhook;
use kxio::{fs::FileSystem, network::Network};

View file

@ -6,11 +6,8 @@ edition = { workspace = true }
[dependencies]
git-next-config = { workspace = true }
git-next-git = { workspace = true }
git-next-forge = { workspace = true }
git-next-repo-actor = { workspace = true }
git-next-actor-macros = { workspace = true }
git-next-file-watcher-actor = { workspace = true }
git-next-webhook-actor = { workspace = true }
git-next-server-actor = { workspace = true }
# logging
console-subscriber = { workspace = true }
@ -20,10 +17,7 @@ tracing-subscriber = { workspace = true }
# fs/network
kxio = { workspace = true }
# boilerplate
derive_more = { workspace = true }
thiserror = { workspace = true }
# Actors
actix = { workspace = true }
actix-rt = { workspace = true }

View file

@ -1 +0,0 @@

View file

@ -1,2 +0,0 @@
pub mod messages;
pub mod server;

View file

@ -1,13 +1,12 @@
//
use crate::actors::server::Server;
use actix::prelude::*;
use git_next_file_watcher_actor::{FileUpdated, FileWatcher};
use git_next_git::repository::RepositoryFactory;
use git_next_server_actor::Server;
use kxio::{fs::FileSystem, network::Network};
use std::path::PathBuf;
use tracing::{error, info, level_filters::LevelFilter};
mod actors;
mod config;
pub fn init(fs: FileSystem) {