Conversation
|
|
||
| async fn delete_opts(&self, location: &Path, opts: DeleteOptions) -> Result<()> { | ||
| let _ = (location, opts); | ||
| Err(crate::Error::NotImplemented { |
There was a problem hiding this comment.
This seems to be strictly worse than the default impl?
|
Tagging @crepererum as this sort of overlaps with #549 |
|
I should have considered this in #549. Reading the Azure docs though, I think etag matching is also supported by the bulk request variant. So I think we could design an API like this: pub struct DeleteLocation {
pub path: Path,
pub if_match: Option<String>,
}
#[derive(Debug, Clone, Default)]
pub struct DeleteOptions {
pub extensions: Extensions,
}
trait ObjectStore {
fn delete_stream_opts(
&self,
locations: BoxStream<'static, Result<DeleteLocation>>,
opts: DeleteOptions,
) -> BoxStream<'static, Result<Path>>;
}
// move `delete_stream` to `ObjectStoreExt`i.e. have the extensions ONCE but have per-location matchers. |
|
Coming back to this, I think having a separate delete_opts makes sense and has symmetry with get_opts and get_ranges, where we have a unary method with a full set of functionality, and a more limited batch version. |
| /// Delete will succeed if the `ObjectMeta::e_tag` matches | ||
| /// otherwise returning [`Error::Precondition`] | ||
| /// | ||
| /// See <https://datatracker.ietf.org/doc/html/rfc9110#name-if-match> | ||
| /// | ||
| /// Examples: | ||
| /// | ||
| /// ```text | ||
| /// If-Match: "xyzzy" | ||
| /// If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz" | ||
| /// If-Match: * | ||
| /// ``` | ||
| pub if_match: Option<String>, |
There was a problem hiding this comment.
I think this will need to use something similar to UpdateVersion found in PutMode as some stores don't support If-Match on mutating methods
| .idempotent(true); | ||
|
|
||
| if let Some(if_match) = &opts.if_match { | ||
| builder = builder.header(&HeaderName::from_static("if-match"), if_match); |
There was a problem hiding this comment.
Have you tested this?
The docs would suggest If-Match is only supported on GET and HEAD
https://docs.cloud.google.com/storage/docs/xml-api/reference-headers#ifmatch
This is why PutMode has UpdateVersion
Which issue does this PR close?
Closes #298 .
Supersedes the now stale PR #427