GoogleCloudPlatform / GoogleCloudPlatform/grpc-gcp-php

Swap from wrapped Client to pure gRPC Client

Open
#4 9 comments 0 reactions 1 assignee Claimed by @slaff View on GitHub
Dominant language
PHP
Stars
187
Forks
18
PR merge metrics
No merged PRs in 30d

Description

The FirestoreClient you use is download from Google Cloud by composer, which actually is wrapper around gRPC. This API is designed to face the customers, with some gRPC parameters unseen by the user.
However, we want to test the gRPC features with this tests, which means the Client should be pure gRPC Client generated directly from proto files. The only thing needed to be downloaded by composer is [auth API.](https://grpc.io/docs/guides/auth.html#authenticate-with-google-using-oauth2-token-legacy-approach-1).

There are 2 ways to changing your current wrapper Client to pure gRPC Client, which I recommend 2:

1. use the FirestoreClient under `vendor/google/proto-client/src/Google/Cloud/Firestore/V1beta1/FirestoreGrpcClient.php`

2. Generate FirestoreClient by your own.
For example, my way to generate pb files:
```
git clone git@github.com:googleapis/googleapis.git
cd googleapis
make LANGUAGE=php OUTPUT=~/grpc-gcp-php/firestore/examples/end2end/src
```

Then change your current Client to the one in `~/grpc-gcp-php/firestore/examples/end2end/src/Google/Cloud/Firestore/V1beta1/FirestoreClient.php`,
and then set the [credentials](https://grpc.io/docs/guides/auth.html#authenticate-with-google-using-oauth2-token-legacy-approach-1) with it.
I also have a related example of [creating pure Logging gRPC client](https://github.com/GoogleCloudPlatform/google-cloud-php/pull/712/files#diff-8a3176e1df78bab7c0dc29980d57873dR127) for you as reference.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.