You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "FrankYang0529 (via GitHub)" <gi...@apache.org> on 2026/06/01 12:54:51 UTC
[I] new feature: Add delete options support for Go binding [opendal]
FrankYang0529 opened a new issue, #7663:
URL: https://github.com/apache/opendal/issues/7663
### Feature Description
Add DeleteOptions support to the Go binding's Delete operation.
Currently, the Go binding only exposes:
```
func (op *Operator) Delete(path string) error
```
The Rust core supports two additional options via `DeleteOptions`:
* version — delete a specific version of an object (useful for versioned storage backends such as S3 versioning, GCS object versioning)
* recursive — recursively delete all objects under a given path prefix
The Go binding should expose an equivalent `DeleteWith` function (or functional options pattern consistent with the existing `List` options style) to support these options.
### Problem and Solution
Users of the Go binding who work with versioned storage backends (e.g. S3 with versioning enabled) cannot delete a specific version of an object. They also cannot perform a recursive delete without manually listing and deleting each object, which is error-prone and inefficient.
The Rust core already supports both capabilities via `DeleteOptions`:
```
// core/src/types/operator/operator_futures.rs
pub struct DeleteOptions {
pub version: Option<String>,
pub recursive: bool,
}
```
Solution:
Implement `DeleteWith` in the Go binding using the same functional options pattern already used by `ListWith`:
```
// Option types
type DeleteOption func(*deleteOptions)
type deleteOptions struct {
version string
recursive bool
}
func DeleteWithVersion(version string) DeleteOption {
return func(o *deleteOptions) { o.version = version }
}
func DeleteWithRecursive() DeleteOption {
return func(o *deleteOptions) { o.recursive = true }
}
// New method on Operator
func (op *Operator) DeleteWith(path string, opts ...DeleteOption) error
```
### Additional Context
_No response_
### Are you willing to contribute to the development of this feature?
- [x] Yes, I am willing to contribute to the development of this feature.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] new feature: Add delete options support for Go binding [opendal]
Posted by "dentiny (via GitHub)" <gi...@apache.org>.
dentiny closed issue #7663: new feature: Add delete options support for Go binding
URL: https://github.com/apache/opendal/issues/7663
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org