https://github.com/dariofad/grpc_py_go_example
Calling Go from Python via gRPC (example). TLS multi support.
https://github.com/dariofad/grpc_py_go_example
go grpc python3 tls
Last synced: 3 months ago
JSON representation
Calling Go from Python via gRPC (example). TLS multi support.
- Host: GitHub
- URL: https://github.com/dariofad/grpc_py_go_example
- Owner: dariofad
- License: apache-2.0
- Created: 2022-03-05T15:11:41.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-02-24T14:08:37.000Z (over 2 years ago)
- Last Synced: 2025-01-19T13:55:39.023Z (4 months ago)
- Topics: go, grpc, python3, tls
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Calling Go from Python via gRPC
This repo is an example to show how to make remote procedure calls via
gRPC between Python and Go. TLS (multi) is used to secure the network
communication.Read [this
article](https://dariofad.github.io/2022/05/20/Calling_go_from_python_via_grpc.html)
for a complete walk-through.## Quickstart
+ install `direnv` as a shell extension
+ run `direnv allow`
+ install `Python` and `Go` (1.18)
+ run `make setup`
+ open two terminal windows and run respectively:
- `make server`
- `make client`
+ run `make stop` to shutdown the server
+ run `make clean` to remove the installed binaries### The example
Basic explanation. Imagine you have a web mapping platform like Google
Maps, you may have some satellites scanning the Earth and storing the
data on a server, and clients performing some queries to the server to
get the view of a location. For simplicity, assume you already have a
80x32 (width, height) 2D map of the Earth stored on the server. The
goal is to support queries to get the image associated with the `xy`
coordinate of a location, and also queries to get the view associated
with a broader rectangular area delimited by the `xy` coordinates
associated with its bottom-left and top-right corners. Also, you may
want to encrypt the communication between client and server to counter
eavesdropping and ensure no third-parties are able to perform MITM
attacks (i.e., like replacing the image associated with a coordinate).