use crate::repo::PostgresBlockStore; use crate::storage::{BlobStorage, S3BlobStorage}; use sqlx::PgPool; use std::sync::Arc; #[derive(Clone)] pub struct AppState { pub db: PgPool, pub block_store: PostgresBlockStore, pub blob_store: Arc, } impl AppState { pub async fn new(db: PgPool) -> Self { let block_store = PostgresBlockStore::new(db.clone()); let blob_store = S3BlobStorage::new().await; Self { db, block_store, blob_store: Arc::new(blob_store), } } }