You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by GitBox <gi...@apache.org> on 2023/04/11 07:40:07 UTC

[GitHub] [incubator-opendal] Ji-Xinyou edited a comment on the discussion: The map construction in opendal's C binding

GitHub user Ji-Xinyou edited a comment on the discussion: The map construction in opendal's C binding

> > Also, different backends use different KVs, if we are using the AWS way, we accept params like `opendal_operatior_config`.
> 
> Every service will have their own builder like `opendal_service_s3_builder`. The hashmap thing is an easier way to build a `S3Builder`. And finally, we will use the builder to build the service.

So what about this way of API.

Builders:
```C
opendal_builder_fs opendal_builder_fs_new(struct opendal_builder_fs_config);
opendal_builder_memory opendal_builder_memory_new(struct opendal_builder_memory_config);
```

Operators:
```C
opendal_operator_ptr opendal_operator_new(char *scheme, void *builder);
```

And in runtime we cast the `void*` to what we want (the C way generics lol).

GitHub link: https://github.com/apache/incubator-opendal/discussions/1904#discussioncomment-5577577

----
This is an automatically sent email for commits@opendal.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@opendal.apache.org