googleapis / googleapis/google-cloud-java

[java-storage] Storage endpoint as env var

Aperta
#12,650 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
api: storage type: feature request
Lingua principale
Java
Stelle
2.1k
Fork
1.2k
Merge medio
1g 23h
PR unite (30g)
154

Descrizione

**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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.