Created
June 2, 2022 10:03
-
-
Save koradon/8742ab654c874caa4ca44e9de5411ee7 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 UserStoreServicer | |
class UserStoreServicer(UserStoreServicer): | |
def GetUserDataByEmail(self, request: UserEmailRequest, context): | |
user = … # your code for fetching the user data | |
return UserResponse( | |
user=User( | |
email=user.email, | |
firstname=user.firstname, | |
lastname=user.lastname | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment