Skip to content

services/s3: Add helper function in S3Builder to detect region #2632

@Xuanwo

Description

@Xuanwo

We can implement a helper function for S3Builder like async fn detect_region(&self) -> Result<Option<String>> to make it easier to find region.

I want an API of S3Builder like async fn detect_region(&self) -> Result<Option<String>>, it's used to fetch region with input endpoint and bucket. (Maybe API should be async fn detect_region(&self, endpoint: &str, bucket: &str)?)

The API should use the client in S3Builder to detect the region, the behavior will be similiar to

https://github.com/apache/incubator-opendal/blob/44e93563227e58520f07e0ebcf3be14601b59d9a/src/services/s3/backend.rs#L504-L604

The caller can use this function to detect region when they needed in async context. (Please note that S3Builder::build is blocking API, so we can't do this.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions