A gRPC example with a Go server and Python client that exhibits the 3 (of the 4) kinds of service methods.
Install the protocol compiler plugins for Go:
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]Install required python libraries:
pip install -r client/requirements.txtGenerate Go and Python files from .proto service definition.
# Server (Go) files
protoc --go_out=server --go_opt=paths=source_relative --go-grpc_out=server --go-grpc_opt=paths=source_relative model/todo.proto
# Client (Python) files
python -m grpc_tools.protoc -I model --python_out=client --pyi_out=client --grpc_python_out=client model/todo.protoStart server with:
cd server
go mod tidy
go run . -port=8080In a different terminal window, run client with:
cd client
python client.py