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 anyhow::Result;
|
||||||
|
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use crate::processes::feed_server::FeedServer;
|
use crate::processes::FeedServer;
|
||||||
use crate::processes::post_indexer::PostIndexer;
|
use crate::processes::PostIndexer;
|
||||||
use crate::processes::profile_classifier::ProfileClassifier;
|
use crate::processes::ProfileClassifier;
|
||||||
use crate::services::ai::AI;
|
use crate::services::AI;
|
||||||
use crate::services::bluesky::Bluesky;
|
use crate::services::Bluesky;
|
||||||
use crate::services::database::Database;
|
use crate::services::Database;
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<()> {
|
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 axum::{Router, Server};
|
||||||
|
|
||||||
use crate::config::Config;
|
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::endpoints::{describe_feed_generator, did_json, get_feed_skeleton, root};
|
||||||
use super::state::FeedServerState;
|
use super::state::FeedServerState;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use crate::services::database::Database;
|
use crate::services::Database;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct FeedServerState {
|
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 async_trait::async_trait;
|
||||||
|
|
||||||
use crate::services::bluesky::{Bluesky, Operation, OperationProcessor};
|
use crate::services::bluesky::{Bluesky, Operation, OperationProcessor};
|
||||||
use crate::services::database::Database;
|
use crate::services::Database;
|
||||||
|
|
||||||
pub struct PostIndexer<'a> {
|
pub struct PostIndexer<'a> {
|
||||||
database: &'a Database,
|
database: &'a Database,
|
||||||
|
|
|
@ -2,9 +2,9 @@ use std::time::Duration;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
|
||||||
use crate::services::ai::AI;
|
use crate::services::AI;
|
||||||
use crate::services::bluesky::Bluesky;
|
use crate::services::Bluesky;
|
||||||
use crate::services::database::Database;
|
use crate::services::Database;
|
||||||
|
|
||||||
pub struct ProfileClassifier<'a> {
|
pub struct ProfileClassifier<'a> {
|
||||||
database: &'a Database,
|
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