Skip to content

Swap from wrapped Client to pure gRPC Client #4

Description

@ZhouyihaiDing

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

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 with it.
I also have a related example of creating pure Logging gRPC client for you as reference.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions