You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2023/08/04 04:11:25 UTC
[incubator-opendal] 01/01: rfc: Lister API
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch add-lister-api
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
commit 9eaadf3215590751178a6acb7eb9667c7d37ead7
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Fri Aug 4 12:11:09 2023 +0800
rfc: Lister API
Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
core/src/docs/rfcs/0000_lister_api.md | 65 +++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
diff --git a/core/src/docs/rfcs/0000_lister_api.md b/core/src/docs/rfcs/0000_lister_api.md
new file mode 100644
index 000000000..a9fb0f2e1
--- /dev/null
+++ b/core/src/docs/rfcs/0000_lister_api.md
@@ -0,0 +1,65 @@
+- Proposal Name: `lister_api`
+- Start Date: 2023-08-04
+- RFC PR: [apache/incubator-opendal#0000](https://github.com/apache/incubator-opendal/pull/0000)
+- Tracking Issue: [apache/incubator-opendal#0000](https://github.com/apache/incubator-opendal/issues/0000)
+
+# Summary
+
+Add `lister` API to align with other OpenDAL APIs like `read`/`reader`.
+
+# Motivation
+
+Currently OpenDAL has `list` APIs like:
+
+```rust
+let lister = op.list().await?;
+```
+
+This is inconsistent with APIs like `read`/`reader` and can confuse users.
+
+We should add a new `lister` API and change the `list` to:
+
+- Align with other OpenDAL APIs
+- Simplify usage
+
+# Guide-level explanation
+
+The new APIs will be:
+
+```rust
+let entries = op.list().await?; // Get entries directly
+
+let lister = op.lister().await?; // Get lister
+```
+
+- `op.list()` returns entries directly.
+- `op.lister()` returns a lister that users can list entries on demand.
+
+# Reference-level explanation
+
+We will:
+
+- Rename existing `list` to `lister`
+- Add new `list` method to call `lister` and return all entries
+
+This keeps the pagination logic encapsulated in `lister`.
+
+# Drawbacks
+
+None
+
+# Rationale and alternatives
+
+None
+
+# Prior art
+
+None
+
+# Unresolved questions
+
+None
+
+# Future possibilities
+
+None