2024-11-17 15:43:37 +01:00
|
|
|
use std::time::SystemTime;
|
2024-11-10 13:42:19 +01:00
|
|
|
|
2024-11-17 15:43:37 +01:00
|
|
|
use async_trait::async_trait;
|
2024-11-10 13:42:19 +01:00
|
|
|
|
2024-11-17 15:43:37 +01:00
|
|
|
pub mod local;
|
|
|
|
#[cfg(feature = "s3")]
|
|
|
|
pub mod s3;
|
2024-11-10 13:42:19 +01:00
|
|
|
|
2024-11-17 15:43:37 +01:00
|
|
|
#[async_trait]
|
|
|
|
pub trait StorageBackend {
|
|
|
|
async fn flush_segment(&self, topic: &str, buffer: &[u8]) -> anyhow::Result<String>;
|
|
|
|
async fn append_index(
|
2024-11-10 13:42:19 +01:00
|
|
|
&self,
|
|
|
|
topic: &str,
|
|
|
|
segment_file: &str,
|
|
|
|
time: SystemTime,
|
2024-11-17 15:43:37 +01:00
|
|
|
) -> anyhow::Result<()>;
|
2024-11-10 13:42:19 +01:00
|
|
|
}
|