nodata/crates/nodata-storage/src/backend.rs

19 lines
389 B
Rust
Raw Normal View History

use std::time::SystemTime;
use async_trait::async_trait;
pub mod local;
#[cfg(feature = "s3")]
pub mod s3;
#[async_trait]
pub trait StorageBackend {
async fn flush_segment(&self, topic: &str, buffer: &[u8]) -> anyhow::Result<String>;
async fn append_index(
&self,
topic: &str,
segment_file: &str,
time: SystemTime,
) -> anyhow::Result<()>;
}