Skip to content

Commit

Permalink
feat(datastore): emulator environment variable (#14100)
Browse files Browse the repository at this point in the history
  • Loading branch information
coryan committed May 1, 2024
1 parent ebd2928 commit 49061d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions generator/generator_config.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -1863,13 +1863,15 @@ service {
product_path: "google/cloud/datastore/admin/v1"
initial_copyright_year: "2023"
retryable_status_codes: ["kUnavailable"]
emulator_endpoint_env_var: "DATASTORE_EMULATOR_HOST"
}
service {
service_proto_path: "google/datastore/v1/datastore.proto"
product_path: "google/cloud/datastore/v1"
initial_copyright_year: "2023"
retryable_status_codes: ["kUnavailable"]
emulator_endpoint_env_var: "DATASTORE_EMULATOR_HOST"
}
# Datastream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ auto constexpr kBackoffScaling = 2.0;

Options DatastoreAdminDefaultOptions(Options options) {
options = internal::PopulateCommonOptions(
std::move(options), "GOOGLE_CLOUD_CPP_DATASTORE_ADMIN_ENDPOINT", "",
"GOOGLE_CLOUD_CPP_DATASTORE_ADMIN_AUTHORITY", "datastore.googleapis.com");
std::move(options), "GOOGLE_CLOUD_CPP_DATASTORE_ADMIN_ENDPOINT",
"DATASTORE_EMULATOR_HOST", "GOOGLE_CLOUD_CPP_DATASTORE_ADMIN_AUTHORITY",
"datastore.googleapis.com");
options = internal::PopulateGrpcOptions(std::move(options));
if (!options.has<datastore_admin_v1::DatastoreAdminRetryPolicyOption>()) {
options.set<datastore_admin_v1::DatastoreAdminRetryPolicyOption>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ auto constexpr kBackoffScaling = 2.0;

Options DatastoreDefaultOptions(Options options) {
options = internal::PopulateCommonOptions(
std::move(options), "GOOGLE_CLOUD_CPP_DATASTORE_ENDPOINT", "",
"GOOGLE_CLOUD_CPP_DATASTORE_AUTHORITY", "datastore.googleapis.com");
std::move(options), "GOOGLE_CLOUD_CPP_DATASTORE_ENDPOINT",
"DATASTORE_EMULATOR_HOST", "GOOGLE_CLOUD_CPP_DATASTORE_AUTHORITY",
"datastore.googleapis.com");
options = internal::PopulateGrpcOptions(std::move(options));
if (!options.has<datastore_v1::DatastoreRetryPolicyOption>()) {
options.set<datastore_v1::DatastoreRetryPolicyOption>(
Expand Down

0 comments on commit 49061d8

Please sign in to comment.