This example demonstrates how to play around with our privacy modification to gRPC.
For convenience, the generated .pb.go files are already included for you. If you want the full experience, follow these prerequisites to produce them from helloworld/helloworld/demo.proto --- otherwise, if you just want to get started, you can skip these steps:
-
Install
protoc. -
Download our modified
grpc-go. Navigate tocmd/protoc-gen-go-gprc, and rungo install . -
Download our modified
protobuf-go. Navigate tocmd/protoc-gen-go, and rungo install . -
cd helloworld/helloworld/demo.protoand run using the following command:protoc --go_out=. --go-grpc_out=. demo.protoThis will create a folder containing generated
helloworld.pb.goandhelloworld_grpc.pb.gofor you. Replace the corresponding files inhelloworld/helloworldwith these values.
Follow these setup to run the [quick start][] example:
-
Run the server:
cd helloworld/greeter_server/ GRPC_PRIVACY_POLICY_LOCATION=privacy_policy.json go run .
-
Run the client:
cd helloworld/greeter_client/ go run .
You can amend the provided helloworld/greeter_server/privacy_policy.json file to your heart's content.
For full insight into what's happening under the hood, we recommend enabling debug-level logging by uncommenting line 58 in greeter_server/main.go.