Add CapabilityCheckLayer
Hi, this PR suggests that we consider introducing a layer to handle unsupported behaviors. Not all users and use cases are concerned about whether services support versioning; they might simply want to write code consistently and return it as is if not supported.
We have similar code here: https://github.com/apache/opendal/blob/d479ac39efa9a88e10448ad81e47292b3b4ed688/core/src/layers/complete.rs#L132-L140
I think we can create a new layer called CapabilityCheckLayer. By default, opendal will not perform any capability checks. Users can enable CapabilityCheckLayer to ensure the features they use are supported and behave as expected.
CapabilityCheckLayer may have different modes:
- Default: just bypass all checks, like the opendal default behavior.
- Correctness: only check capability that affected correctness, for example, write with if none match, read with version.
- All: check all capabilities.
Originally posted by @Xuanwo in https://github.com/apache/opendal/pull/5145#discussion_r1778959423
Hello, @meteorgan, are you interested in helping with the implementation? I believe we should transfer most of the check code to the new layer instead.
Hello, @meteorgan, are you interested in helping with the implementation? I believe we should transfer most of the check code to the new layer instead.
Yes, I'd love to. I'm still working on other projects, but I can start this one later this week.
Yes, I'd love to. I'm still working on other projects, but I can start this one later this week.
Greatly appreciated. Thank you in advance.