googleapis / googleapis/google-cloud-java
[java-storage] Storage endpoint as env var
- Vorherrschende Sprache
- Java
- Sterne
- 2.1k
- Forks
- 1.2k
- Ø Merge
- 1 T. 23 Std.
- Gemergte PRs (30 T.)
- 154
Beschreibung
**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.
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.