googleapis / googleapis/google-cloud-java

[java-storage] Storage endpoint as env var

未关闭
#12,650 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
api: storage type: feature request
主要语言
Java
星标
2.1k
派生
1.2k
平均合并
1 天 23 小时
30 天内合并 PR
154

描述

**Is your feature request related to a problem? Please describe.**
In order to test storage integration locally I need to setup host in StorageOption Builder by myself, like this:

```java
final storageEndpoint = System.getenv("STORAGE_ENDPOINT");
StorageOption.newBuilder().setHost(storageEndpoint).build().getService();
```

**Describe the solution you'd like**
It can be easier and more time proof if `StorageOption.DEFAULT_HOST` use a env var to get it's value.

**Describe alternatives you've considered**
I think about something like this in `StorageOptions` class:
```java
private static final String DEFAULT_HOST = System.getenv().getOrDefault("STORAGE_HOST", "https://storage.googleapis.com");
```

I can open a PR if you agree with this implementation or have any other idea.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。