示例#1
0
 def GetState(self, request, context):
     key = request.key
     if key not in self.store:
         return empty_pb2.Empty()
     else:
         data, etag = self.store[key]
         if request.metadata["upper"]:
             data = to_bytes(data.decode("utf-8").upper())
         return api_v1.GetStateResponse(data=data, etag=etag)
示例#2
0
 def GetState(self, request, context):
     key = request.key
     if key not in self.store:
         return empty_pb2.Empty()
     else:
         return api_v1.GetStateResponse(data=self.store[key], etag="")