Convert into more modern Rust module structure
And also use re-exports liberally for shorter imports
This commit is contained in:
parent
227118dfb1
commit
944be0cd5a
12
src/main.rs
12
src/main.rs
|
@ -5,12 +5,12 @@ mod services;
|
|||
use anyhow::Result;
|
||||
|
||||
use crate::config::Config;
|
||||
use crate::processes::feed_server::FeedServer;
|
||||
use crate::processes::post_indexer::PostIndexer;
|
||||
use crate::processes::profile_classifier::ProfileClassifier;
|
||||
use crate::services::ai::AI;
|
||||
use crate::services::bluesky::Bluesky;
|
||||
use crate::services::database::Database;
|
||||
use crate::processes::FeedServer;
|
||||
use crate::processes::PostIndexer;
|
||||
use crate::processes::ProfileClassifier;
|
||||
use crate::services::AI;
|
||||
use crate::services::Bluesky;
|
||||
use crate::services::Database;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
mod feed_server;
|
||||
mod post_indexer;
|
||||
mod profile_classifier;
|
||||
|
||||
pub use feed_server::FeedServer;
|
||||
pub use post_indexer::PostIndexer;
|
||||
pub use profile_classifier::ProfileClassifier;
|
|
@ -5,7 +5,7 @@ use axum::routing::get;
|
|||
use axum::{Router, Server};
|
||||
|
||||
use crate::config::Config;
|
||||
use crate::services::database::Database;
|
||||
use crate::services::Database;
|
||||
|
||||
use super::endpoints::{describe_feed_generator, did_json, get_feed_skeleton, root};
|
||||
use super::state::FeedServerState;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use crate::config::Config;
|
||||
use crate::services::database::Database;
|
||||
use crate::services::Database;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct FeedServerState {
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
pub mod feed_server;
|
||||
pub mod post_indexer;
|
||||
pub mod profile_classifier;
|
|
@ -2,7 +2,7 @@ use anyhow::Result;
|
|||
use async_trait::async_trait;
|
||||
|
||||
use crate::services::bluesky::{Bluesky, Operation, OperationProcessor};
|
||||
use crate::services::database::Database;
|
||||
use crate::services::Database;
|
||||
|
||||
pub struct PostIndexer<'a> {
|
||||
database: &'a Database,
|
||||
|
|
|
@ -2,9 +2,9 @@ use std::time::Duration;
|
|||
|
||||
use anyhow::Result;
|
||||
|
||||
use crate::services::ai::AI;
|
||||
use crate::services::bluesky::Bluesky;
|
||||
use crate::services::database::Database;
|
||||
use crate::services::AI;
|
||||
use crate::services::Bluesky;
|
||||
use crate::services::Database;
|
||||
|
||||
pub struct ProfileClassifier<'a> {
|
||||
database: &'a Database,
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
mod ai;
|
||||
pub mod bluesky;
|
||||
mod database;
|
||||
|
||||
pub use ai::AI;
|
||||
pub use bluesky::Bluesky;
|
||||
pub use database::Database;
|
|
@ -1,3 +0,0 @@
|
|||
pub mod ai;
|
||||
pub mod bluesky;
|
||||
pub mod database;
|
Loading…
Reference in New Issue