mod filesystem; mod mysql; mod mysql_restore; mod postgres; mod postgres_restore; mod ssh; pub use filesystem::*; pub use mysql::MysqlSource; pub use mysql_restore::MysqlRestore; pub use postgres::*; pub use postgres_restore::{PostgresReset, PostgresRestore}; pub use ssh::SshEndpoint; use anyhow::Result; use async_trait::async_trait; use serde_json::Value; use tessera_core::config::ProviderKind; #[async_trait] pub trait BackupProvider: Send + Sync { fn kind(&self) -> ProviderKind; async fn capture(&self) -> Result; } #[derive(Debug, Clone)] pub struct CaptureResult { pub payload: Vec, pub labels: Vec, pub restore_hints: Value, } pub fn provider_from_config( kind: &ProviderKind, config: &Value, ) -> Result> { match kind { ProviderKind::Filesystem => Ok(Box::new(FilesystemProvider::from_config(config)?)), ProviderKind::Postgres => Ok(Box::new(PostgresProvider::from_config(config)?)), ProviderKind::Command => { anyhow::bail!("command provider is outside this release; use filesystem or postgres") } } }