Skip to content

Instantly share code, notes, and snippets.

@koradon
Created June 2, 2022 10:01
Show Gist options
  • Save koradon/f49611b1226d95e408fbd28cd860f9b7 to your computer and use it in GitHub Desktop.
Save koradon/f49611b1226d95e408fbd28cd860f9b7 to your computer and use it in GitHub Desktop.
import grpc
from protos.user_store_pb2 import User, UserResponse, UserEmailRequest,
from protos.user_store_pb2_grpc import UserStoreStub
def run():
with grpc.insecure_channel('localhost:50051') as channel:
stub = _pb2_grpc.UserStoreStub(channel)
response = stub.GetUserDataByEmail(
UserEmailRequest(email="[email protected]")
)
print(f"response user: {response.user}")
if __name__ == '__main__':
logging.basicConfig()
run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment