googleapis / googleapis/google-cloud-java

[java-storage] Storage endpoint as env var

Đang mở
#12,650 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
api: storage type: feature request
Ngôn ngữ chính
Java
Star
2.1k
Fork
1.2k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
154

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.