pub struct Store { /* private fields */ }Implementations§
Source§impl Store
impl Store
Sourcepub fn new(bucket: &str, region: &str, endpoint: Option<&str>) -> Result<Self>
pub fn new(bucket: &str, region: &str, endpoint: Option<&str>) -> Result<Self>
Build the store from the resolved bucket/region/endpoint, resolving
credentials from secrets.toml. Takes plain fields rather than the
CLI’s Config type: Config doesn’t live in dove-core (it becomes the
backend registry in a later extraction step), so this constructor
stays decoupled from it — callers pass the fields they already have.
Sourcepub fn presign_get(&self, key: &str, ttl: Duration) -> String
pub fn presign_get(&self, key: &str, ttl: Duration) -> String
A presigned GET URL for key, valid for ttl. This is the link handed
to a recipient; ttl is capped at 7 days by the caller (SigV4 limit).
Sourcepub fn put_object(&self, key: &str, body: &[u8]) -> Result<()>
pub fn put_object(&self, key: &str, body: &[u8]) -> Result<()>
Upload body to key. (Whole-object PUT; multipart streaming for very
large files is a follow-up that pairs with the chunked-encryption work.)
Sourcepub fn delete_object(&self, key: &str) -> Result<()>
pub fn delete_object(&self, key: &str) -> Result<()>
Delete key — how dove revoke kills a share early (the link then 404s).
Sourcepub fn list(&self, prefix: &str) -> Result<Vec<String>>
pub fn list(&self, prefix: &str) -> Result<Vec<String>>
All object keys under prefix, following continuation tokens so listings
past the first 1000 aren’t silently dropped.
Sourcepub fn put_file(
&self,
key: &str,
path: &Path,
progress: &dyn Progress,
) -> Result<u64>
pub fn put_file( &self, key: &str, path: &Path, progress: &dyn Progress, ) -> Result<u64>
Stream a file to key, reporting cumulative bytes uploaded via
progress.bytes(uploaded, total) as it goes. Content-Length is set
from the file size, so S3 gets a single sized PUT and the body streams
rather than buffering the whole file in memory. Returns the total byte
count.