feat(libertas_api): add dependency on libertas_infra and async-nats refactor(libertas_api): consolidate config loading and add broker_url refactor(libertas_api): integrate NATS client into app state and services feat(libertas_core): introduce config module for database and server settings fix(libertas_core): enhance error handling with detailed messages feat(libertas_infra): create infrastructure layer with database repositories feat(libertas_infra): implement Postgres repositories for media and albums feat(libertas_worker): add worker service to process media jobs via NATS
27 lines
594 B
Rust
27 lines
594 B
Rust
use std::sync::Arc;
|
|
|
|
use async_trait::async_trait;
|
|
|
|
use crate::{
|
|
error::CoreResult,
|
|
models::Media,
|
|
repositories::{AlbumRepository, MediaRepository, UserRepository},
|
|
};
|
|
|
|
pub struct PluginData {
|
|
pub message: String,
|
|
}
|
|
|
|
pub struct PluginContext {
|
|
pub media_repo: Arc<dyn MediaRepository>,
|
|
pub album_repo: Arc<dyn AlbumRepository>,
|
|
pub user_repo: Arc<dyn UserRepository>,
|
|
}
|
|
|
|
#[async_trait]
|
|
pub trait MediaProcessorPlugin: Send + Sync {
|
|
fn name(&self) -> &'static str;
|
|
|
|
async fn process(&self, media: &Media, context: &PluginContext) -> CoreResult<PluginData>;
|
|
}
|