refactos: extract server-actor crate
All checks were successful
Rust / build (push) Successful in 1m31s
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful

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 = [ members = [
"crates/cli", "crates/cli",
"crates/server", "crates/server",
"crates/server-actor",
"crates/config", "crates/config",
"crates/git", "crates/git",
"crates/forge", "crates/forge",
@ -26,6 +27,7 @@ expect_used = "warn"
[workspace.dependencies] [workspace.dependencies]
git-next-server = { path = "crates/server" } git-next-server = { path = "crates/server" }
git-next-server-actor = { path = "crates/server-actor" }
git-next-config = { path = "crates/config" } git-next-config = { path = "crates/config" }
git-next-git = { path = "crates/git" } git-next-git = { path = "crates/git" }
git-next-forge = { path = "crates/forge" } git-next-forge = { path = "crates/forge" }

View file

@ -4,7 +4,8 @@ version = { workspace = true }
edition = { workspace = true } edition = { workspace = true }
[dependencies] [dependencies]
# git-next-config = { workspace = true } git-next-config = { workspace = true }
git-next-actor-macros = { workspace = true }
# git-next-repo-actor = { workspace = true } # git-next-repo-actor = { workspace = true }
# logging # 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 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_actor_macros::message;
use git_next_config as config; 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_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_repo_actor::{messages::CloneRepo, RepoActor};
use git_next_webhook_actor as webhook; use git_next_webhook_actor as webhook;
use kxio::{fs::FileSystem, network::Network}; use kxio::{fs::FileSystem, network::Network};

View file

@ -6,11 +6,8 @@ edition = { workspace = true }
[dependencies] [dependencies]
git-next-config = { workspace = true } git-next-config = { workspace = true }
git-next-git = { 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-file-watcher-actor = { workspace = true }
git-next-webhook-actor = { workspace = true } git-next-server-actor = { workspace = true }
# logging # logging
console-subscriber = { workspace = true } console-subscriber = { workspace = true }
@ -20,10 +17,7 @@ tracing-subscriber = { workspace = true }
# fs/network # fs/network
kxio = { workspace = true } kxio = { workspace = true }
# boilerplate # Actors
derive_more = { workspace = true }
thiserror = { workspace = true }
actix = { workspace = true } actix = { workspace = true }
actix-rt = { 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 actix::prelude::*;
use git_next_file_watcher_actor::{FileUpdated, FileWatcher}; use git_next_file_watcher_actor::{FileUpdated, FileWatcher};
use git_next_git::repository::RepositoryFactory; use git_next_git::repository::RepositoryFactory;
use git_next_server_actor::Server;
use kxio::{fs::FileSystem, network::Network}; use kxio::{fs::FileSystem, network::Network};
use std::path::PathBuf; use std::path::PathBuf;
use tracing::{error, info, level_filters::LevelFilter}; use tracing::{error, info, level_filters::LevelFilter};
mod actors;
mod config; mod config;
pub fn init(fs: FileSystem) { pub fn init(fs: FileSystem) {