nodata/crates/nodata-storage/src/backend.rs
kjuulh c8f4bae1f2
feat: add s3 and deployment
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-11-17 16:07:58 +01:00

19 lines
389 B
Rust

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<()>;
}