This repo is for my own learning. It is to learn about gRPC between python and golang. This will help with iterop of the two language to comunicate with each other.
https://stackoverflow.com/questions/64048132/proto-path-passed-empty-directory-name
protoc --proto_path=. --go_out=. ./addressBook.proto
protoc --proto_path=. --go_out=. --go-grpc_out=. ./helloWorld.proto
python -m grpc_tools.protoc --proto_path=. --python_out=./services/hello-world --grpc_python_out=./services/hello-world ./helloWorld.proto
Thanks to Miki Tebeka for writing this article
- If you want go to call python functions you must generate rpc for both python and go.
- To send data from go to python, we use the
HelloWorldRequest()
from Go RPC which will be caught by the python server on therequest
parameter. - In order for python to send back the data,
HelloWorldResponse
is used to return the response. - We also need to override the service
Print
so that we can manipulate the data that was sent from the client/go. add_HelloWorldServicer_to_server(HelloWorldServer(), server)
This code will add the service to the server