oxigdal_cloud/backends/
mod.rs1#[cfg(feature = "s3")]
7pub mod s3;
8
9#[cfg(feature = "azure-blob")]
10pub mod azure;
11
12#[cfg(feature = "gcs")]
13pub mod gcs;
14
15#[cfg(feature = "http")]
16pub mod http;
17
18#[cfg(feature = "s3")]
19pub use s3::S3Backend;
20
21#[cfg(feature = "azure-blob")]
22pub use azure::AzureBlobBackend;
23
24#[cfg(feature = "gcs")]
25pub use gcs::GcsBackend;
26
27#[cfg(feature = "http")]
28pub use http::HttpBackend;
29
30use crate::error::Result;
31
32#[cfg(feature = "async")]
34#[async_trait::async_trait]
35pub trait CloudStorageBackend: Send + Sync {
36 async fn get(&self, key: &str) -> Result<bytes::Bytes>;
38
39 async fn put(&self, key: &str, data: &[u8]) -> Result<()>;
41
42 async fn delete(&self, key: &str) -> Result<()>;
44
45 async fn exists(&self, key: &str) -> Result<bool>;
47
48 async fn list_prefix(&self, prefix: &str) -> Result<Vec<String>>;
50
51 fn is_readonly(&self) -> bool {
53 false
54 }
55}