Replies: 5 comments 12 replies
This comment has been minimized.
This comment has been minimized.
-
A great proposal to address #1424 👍
This could be trick for services like s3s://example.com/bucket
osss://example.com/bucket Most HTTP-based services require an endpoint that includes a scheme such as s3://bucket/path/to/root?endpoint="https://example.com" This issue has led me to a new design, like the following:
|
Beta Was this translation helpful? Give feedback.
-
Forwared from #1905 (reply in thread)
|
Beta Was this translation helpful? Give feedback.
-
@Xuanwo @frostming , currently I'm using something like this over a typical FYI, link to something similar that
|
Beta Was this translation helpful? Give feedback.
-
are there some further progresses after this discussion? |
Beta Was this translation helpful? Give feedback.
-
Proposal
I propose an alternative approach to create an opendal Operator -- from a resource URI(or URL? either is good) string.
I am new to OpenDAL and feel free to close it if it is already a thing -- That's great!
Examples:
This does the same as
Another example, HDFS:
Advantages
Builder
structs at all. For a minimal interface, anOperator
struct is sufficient, service backends can be set up with a primitive string. This will significantly save the effort of supporting a new language.Possible Solutions
We already have a unique
Scheme
for each Builder, we can give them a unique URL prefix. The URI will be encoded as follows:Where positional arguments are required parameters for the specific service, such as
root
forFs
. Specifically, the URI will be parsed withUrl::parse
, and thequery_pairs
will be fed to the::from_iter()
method of the corresponding Builder to get a builder object. Thanks to the good API design of OpenDAL, these APIs are ready to do this.Be aware because all values are URL components, they must be percent-encoded.
Some concerns
For some services that use URL as the parameter themselves, such as IPFS, the resource URI will be a bit different:
And there can be multiple schemes map to the same builder. Both
http://
andhttps://
map to HTTP builder.This might cause some confusion, so I will leave it to the maintainers to make the choice of how this feature will go.
Beta Was this translation helpful? Give feedback.
All reactions