Created
June 2, 2022 10:01
-
-
Save koradon/f49611b1226d95e408fbd28cd860f9b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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