Update third_party/protobuf to 3.21.4 (#30377)
* Update third_party/protobuf * run tools/distrib/python/make_grpcio_tools.py * regenerate protos for ruby, php * update build_handwritten.yaml * regenerate projects * Build - Use :well_known_type_protos instead of :well_known_protos * Fix target * Update upb * Update Python for Protobuf 4.21 (#140) * Update protobuf dependency on grpcio-tools * Off by one * Drop python 3.6 support * Try upgrading pip * And in the other script * Try to figure out if we're compatible with abi3 * See what we've already got installed * Update the requirements.txt file I didn't know existed * And here too * See what's installed * Let's try that again * Remove * Try to confirm version * Let me see the generated code * Fix non-Bazel test runner * Work for all test directories * Regenerate example protos * Clean up * Generate .pyi files * Fix type checking and linting * Exclude pyi files from isort * Upgrade to 3.21.4 * Update iwyu to get around messy protobuf IWYU rules Co-authored-by: Richard Belleville <gnossen@gmail.com>pull/30495/head
parent
15a81131a8
commit
41ec08c69a
73 changed files with 1697 additions and 2672 deletions
@ -0,0 +1,109 @@ |
||||
# Copyright 2022 The gRPC Authors
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Regenerates all generated files in the Python examples directory.
|
||||
|
||||
ARTIFACTS=
|
||||
|
||||
ARTIFACTS += helloworld/helloworld_pb2.py
|
||||
ARTIFACTS += helloworld/helloworld_pb2_grpc.py
|
||||
ARTIFACTS += helloworld/helloworld_pb2.pyi
|
||||
|
||||
ARTIFACTS += async_streaming/phone_pb2.py
|
||||
ARTIFACTS += async_streaming/phone_pb2_grpc.py
|
||||
ARTIFACTS += async_streaming/phone_pb2.pyi
|
||||
|
||||
ARTIFACTS += hellostreamingworld/hellostreamingworld_pb2.py
|
||||
ARTIFACTS += hellostreamingworld/hellostreamingworld_pb2_grpc.py
|
||||
ARTIFACTS += hellostreamingworld/hellostreamingworld_pb2.pyi
|
||||
|
||||
ARTIFACTS += uds/helloworld_pb2.py
|
||||
ARTIFACTS += uds/helloworld_pb2_grpc.py
|
||||
ARTIFACTS += uds/helloworld_pb2.pyi
|
||||
|
||||
ARTIFACTS += xds/helloworld_pb2.py
|
||||
ARTIFACTS += xds/helloworld_pb2_grpc.py
|
||||
ARTIFACTS += xds/helloworld_pb2.pyi
|
||||
|
||||
ARTIFACTS += multiplex/helloworld_pb2.py
|
||||
ARTIFACTS += multiplex/helloworld_pb2_grpc.py
|
||||
ARTIFACTS += multiplex/helloworld_pb2.pyi
|
||||
|
||||
ARTIFACTS += multiplex/route_guide_pb2.py
|
||||
ARTIFACTS += multiplex/route_guide_pb2_grpc.py
|
||||
ARTIFACTS += multiplex/route_guide_pb2.pyi
|
||||
|
||||
ARTIFACTS += route_guide/route_guide_pb2.py
|
||||
ARTIFACTS += route_guide/route_guide_pb2_grpc.py
|
||||
ARTIFACTS += route_guide/route_guide_pb2.pyi
|
||||
|
||||
ARTIFACTS += interceptors/default_value/helloworld_pb2.py
|
||||
ARTIFACTS += interceptors/default_value/helloworld_pb2_grpc.py
|
||||
ARTIFACTS += interceptors/default_value/helloworld_pb2.pyi
|
||||
|
||||
ARTIFACTS += interceptors/headers/helloworld_pb2.py
|
||||
ARTIFACTS += interceptors/headers/helloworld_pb2_grpc.py
|
||||
ARTIFACTS += interceptors/headers/helloworld_pb2.pyi
|
||||
|
||||
ARTIFACTS += metadata/helloworld_pb2.py
|
||||
ARTIFACTS += metadata/helloworld_pb2_grpc.py
|
||||
ARTIFACTS += metadata/helloworld_pb2.pyi
|
||||
|
||||
ARTIFACTS += data_transmission/demo_pb2.py
|
||||
ARTIFACTS += data_transmission/demo_pb2_grpc.py
|
||||
ARTIFACTS += data_transmission/demo_pb2.pyi
|
||||
|
||||
.PHONY: all |
||||
all: ${ARTIFACTS} |
||||
|
||||
helloworld/helloworld_pb2.py helloworld/helloworld_pb2_grpc.py helloworld/helloworld_pb2.pyi: ../protos/helloworld.proto |
||||
python3 -m grpc_tools.protoc --python_out=helloworld --grpc_python_out=helloworld --pyi_out=helloworld -I ../protos ../protos/helloworld.proto
|
||||
|
||||
async_streaming/phone_pb2.py async_streaming/phone_pb2_grpc.py async_streaming/phone_pb2.pyi: async_streaming/phone.proto |
||||
python3 -m grpc_tools.protoc --python_out=async_streaming --grpc_python_out=async_streaming --pyi_out=async_streaming -I async_streaming async_streaming/phone.proto
|
||||
|
||||
hellostreamingworld/hellostreamingworld_pb2.py hellostreamingworld/hellostreamingworld_pb2_grpc.py hellostreamingworld/hellostreamingworld_pb2.pyi: ../protos/hellostreamingworld.proto |
||||
python3 -m grpc_tools.protoc --python_out=hellostreamingworld --grpc_python_out=hellostreamingworld --pyi_out=hellostreamingworld -I ../protos ../protos/hellostreamingworld.proto
|
||||
|
||||
uds/helloworld_pb2.py uds/helloworld_pb2_grpc.py uds/helloworld_pb2.pyi: ../protos/helloworld.proto |
||||
python3 -m grpc_tools.protoc --python_out=uds --grpc_python_out=uds --pyi_out=uds -I ../protos ../protos/helloworld.proto
|
||||
|
||||
xds/helloworld_pb2.py xds/helloworld_pb2_grpc.py xds/helloworld_pb2.pyi: ../protos/helloworld.proto |
||||
python3 -m grpc_tools.protoc --python_out=xds --grpc_python_out=xds --pyi_out=xds -I ../protos ../protos/helloworld.proto
|
||||
|
||||
multiplex/helloworld_pb2.py multiplex/helloworld_pb2_grpc.py multiplex/helloworld_pb2.pyi: ../protos/helloworld.proto |
||||
python3 -m grpc_tools.protoc --python_out=multiplex --grpc_python_out=multiplex --pyi_out=multiplex -I ../protos ../protos/helloworld.proto
|
||||
|
||||
multiplex/route_guide_pb2.py multiplex/route_guide_pb2_grpc.py multiplex/route_guide_pb2.pyi: ../protos/route_guide.proto |
||||
python3 -m grpc_tools.protoc --python_out=multiplex --grpc_python_out=multiplex --pyi_out=multiplex -I ../protos ../protos/route_guide.proto
|
||||
|
||||
route_guide/route_guide_pb2.py route_guide/route_guide_pb2_grpc.py route_guide/route_guide_pb2.pyi: ../protos/route_guide.proto |
||||
python3 -m grpc_tools.protoc --python_out=route_guide --grpc_python_out=route_guide --pyi_out=route_guide -I ../protos ../protos/route_guide.proto
|
||||
|
||||
|
||||
interceptors/default_value/helloworld_pb2.py interceptors/default_value/helloworld_pb2_grpc.py interceptors/default_value/helloworld_pb2.pyi: ../protos/helloworld.proto |
||||
python3 -m grpc_tools.protoc --python_out=interceptors/default_value --grpc_python_out=interceptors/default_value --pyi_out=interceptors/default_value -I ../protos ../protos/helloworld.proto
|
||||
|
||||
interceptors/headers/helloworld_pb2.py interceptors/headers/helloworld_pb2_grpc.py interceptors/headers/helloworld_pb2.pyi: ../protos/helloworld.proto |
||||
python3 -m grpc_tools.protoc --python_out=interceptors/headers --grpc_python_out=interceptors/headers --pyi_out=interceptors/headers -I ../protos ../protos/helloworld.proto
|
||||
|
||||
metadata/helloworld_pb2.py metadata/helloworld_pb2_grpc.py metadata/helloworld_pb2.pyi: ../protos/helloworld.proto |
||||
python3 -m grpc_tools.protoc --python_out=metadata --grpc_python_out=metadata --pyi_out=metadata -I ../protos ../protos/helloworld.proto
|
||||
|
||||
data_transmission/demo_pb2.py data_transmission/demo_pb2_grpc.py data_transmission/demo_pb2.pyi: data_transmission/demo.proto |
||||
python3 -m grpc_tools.protoc --python_out=data_transmission --grpc_python_out=data_transmission --pyi_out=data_transmission -I data_transmission data_transmission/demo.proto
|
||||
|
||||
.PHONY: clean |
||||
clean: |
||||
rm -f ${ARTIFACTS}
|
@ -0,0 +1,40 @@ |
||||
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper |
||||
from google.protobuf import descriptor as _descriptor |
||||
from google.protobuf import message as _message |
||||
from typing import ClassVar as _ClassVar, Mapping as _Mapping, Optional as _Optional, Union as _Union |
||||
|
||||
DESCRIPTOR: _descriptor.FileDescriptor |
||||
|
||||
class CallInfo(_message.Message): |
||||
__slots__ = ["media", "session_id"] |
||||
MEDIA_FIELD_NUMBER: _ClassVar[int] |
||||
SESSION_ID_FIELD_NUMBER: _ClassVar[int] |
||||
media: str |
||||
session_id: str |
||||
def __init__(self, session_id: _Optional[str] = ..., media: _Optional[str] = ...) -> None: ... |
||||
|
||||
class CallState(_message.Message): |
||||
__slots__ = ["state"] |
||||
class State(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): |
||||
__slots__ = [] |
||||
ACTIVE: CallState.State |
||||
ENDED: CallState.State |
||||
NEW: CallState.State |
||||
STATE_FIELD_NUMBER: _ClassVar[int] |
||||
UNDEFINED: CallState.State |
||||
state: CallState.State |
||||
def __init__(self, state: _Optional[_Union[CallState.State, str]] = ...) -> None: ... |
||||
|
||||
class StreamCallRequest(_message.Message): |
||||
__slots__ = ["phone_number"] |
||||
PHONE_NUMBER_FIELD_NUMBER: _ClassVar[int] |
||||
phone_number: str |
||||
def __init__(self, phone_number: _Optional[str] = ...) -> None: ... |
||||
|
||||
class StreamCallResponse(_message.Message): |
||||
__slots__ = ["call_info", "call_state"] |
||||
CALL_INFO_FIELD_NUMBER: _ClassVar[int] |
||||
CALL_STATE_FIELD_NUMBER: _ClassVar[int] |
||||
call_info: CallInfo |
||||
call_state: CallState |
||||
def __init__(self, call_info: _Optional[_Union[CallInfo, _Mapping]] = ..., call_state: _Optional[_Union[CallState, _Mapping]] = ...) -> None: ... |
@ -0,0 +1,21 @@ |
||||
from google.protobuf import descriptor as _descriptor |
||||
from google.protobuf import message as _message |
||||
from typing import ClassVar as _ClassVar, Optional as _Optional |
||||
|
||||
DESCRIPTOR: _descriptor.FileDescriptor |
||||
|
||||
class Request(_message.Message): |
||||
__slots__ = ["client_id", "request_data"] |
||||
CLIENT_ID_FIELD_NUMBER: _ClassVar[int] |
||||
REQUEST_DATA_FIELD_NUMBER: _ClassVar[int] |
||||
client_id: int |
||||
request_data: str |
||||
def __init__(self, client_id: _Optional[int] = ..., request_data: _Optional[str] = ...) -> None: ... |
||||
|
||||
class Response(_message.Message): |
||||
__slots__ = ["response_data", "server_id"] |
||||
RESPONSE_DATA_FIELD_NUMBER: _ClassVar[int] |
||||
SERVER_ID_FIELD_NUMBER: _ClassVar[int] |
||||
response_data: str |
||||
server_id: int |
||||
def __init__(self, server_id: _Optional[int] = ..., response_data: _Optional[str] = ...) -> None: ... |
@ -1,106 +1,186 @@ |
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! |
||||
"""Client and server classes corresponding to protobuf-defined services.""" |
||||
import grpc |
||||
|
||||
import demo_pb2 as demo__pb2 |
||||
|
||||
|
||||
class GRPCDemoStub(object): |
||||
"""service是用来给GRPC服务定义方法的, 格式固定, 类似于Golang中定义一个接口 |
||||
`service` is used to define methods for GRPC services in a fixed format, similar to defining an interface in Golang |
||||
""" |
||||
"""`service` 是用来给gRPC服务定义方法的, 格式固定, 类似于Golang中定义一个接口 |
||||
`service` is used to define methods for gRPC services in a fixed format, similar to defining |
||||
an interface in Golang |
||||
""" |
||||
|
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
|
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.SimpleMethod = channel.unary_unary( |
||||
'/demo.GRPCDemo/SimpleMethod', |
||||
request_serializer=demo__pb2.Request.SerializeToString, |
||||
response_deserializer=demo__pb2.Response.FromString, |
||||
) |
||||
self.ClientStreamingMethod = channel.stream_unary( |
||||
'/demo.GRPCDemo/ClientStreamingMethod', |
||||
request_serializer=demo__pb2.Request.SerializeToString, |
||||
response_deserializer=demo__pb2.Response.FromString, |
||||
) |
||||
self.ServerStreamingMethod = channel.unary_stream( |
||||
'/demo.GRPCDemo/ServerStreamingMethod', |
||||
request_serializer=demo__pb2.Request.SerializeToString, |
||||
response_deserializer=demo__pb2.Response.FromString, |
||||
) |
||||
self.BidirectionalStreamingMethod = channel.stream_stream( |
||||
'/demo.GRPCDemo/BidirectionalStreamingMethod', |
||||
request_serializer=demo__pb2.Request.SerializeToString, |
||||
response_deserializer=demo__pb2.Response.FromString, |
||||
) |
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.SimpleMethod = channel.unary_unary( |
||||
'/demo.GRPCDemo/SimpleMethod', |
||||
request_serializer=demo__pb2.Request.SerializeToString, |
||||
response_deserializer=demo__pb2.Response.FromString, |
||||
) |
||||
self.ClientStreamingMethod = channel.stream_unary( |
||||
'/demo.GRPCDemo/ClientStreamingMethod', |
||||
request_serializer=demo__pb2.Request.SerializeToString, |
||||
response_deserializer=demo__pb2.Response.FromString, |
||||
) |
||||
self.ServerStreamingMethod = channel.unary_stream( |
||||
'/demo.GRPCDemo/ServerStreamingMethod', |
||||
request_serializer=demo__pb2.Request.SerializeToString, |
||||
response_deserializer=demo__pb2.Response.FromString, |
||||
) |
||||
self.BidirectionalStreamingMethod = channel.stream_stream( |
||||
'/demo.GRPCDemo/BidirectionalStreamingMethod', |
||||
request_serializer=demo__pb2.Request.SerializeToString, |
||||
response_deserializer=demo__pb2.Response.FromString, |
||||
) |
||||
|
||||
|
||||
class GRPCDemoServicer(object): |
||||
"""service是用来给GRPC服务定义方法的, 格式固定, 类似于Golang中定义一个接口 |
||||
`service` is used to define methods for GRPC services in a fixed format, similar to defining an interface in Golang |
||||
""" |
||||
|
||||
def SimpleMethod(self, request, context): |
||||
"""简单模式 |
||||
unary-unary |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def ClientStreamingMethod(self, request_iterator, context): |
||||
"""客户端流模式(在一次调用中, 客户端可以多次向服务器传输数据, 但是服务器只能返回一次响应) |
||||
stream-unary (In a single call, the client can transfer data to the server several times, |
||||
but the server can only return a response once.) |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def ServerStreamingMethod(self, request, context): |
||||
"""服务端流模式(在一次调用中, 客户端只能一次向服务器传输数据, 但是服务器可以多次返回响应) |
||||
unary-stream (In a single call, the client can only transmit data to the server at one time, |
||||
but the server can return the response many times.) |
||||
"""`service` 是用来给gRPC服务定义方法的, 格式固定, 类似于Golang中定义一个接口 |
||||
`service` is used to define methods for gRPC services in a fixed format, similar to defining |
||||
an interface in Golang |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def BidirectionalStreamingMethod(self, request_iterator, context): |
||||
"""双向流模式 (在一次调用中, 客户端和服务器都可以向对方多次收发数据) |
||||
stream-stream (In a single call, both client and server can send and receive data |
||||
to each other multiple times.) |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def SimpleMethod(self, request, context): |
||||
"""一元模式(在一次调用中, 客户端只能向服务器传输一次请求数据, 服务器也只能返回一次响应) |
||||
unary-unary(In a single call, the client can only send request once, and the server can |
||||
only respond once.) |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def ClientStreamingMethod(self, request_iterator, context): |
||||
"""客户端流模式(在一次调用中, 客户端可以多次向服务器传输数据, 但是服务器只能返回一次响应) |
||||
stream-unary (In a single call, the client can transfer data to the server several times, |
||||
but the server can only return a response once.) |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def ServerStreamingMethod(self, request, context): |
||||
"""服务端流模式(在一次调用中, 客户端只能一次向服务器传输数据, 但是服务器可以多次返回响应) |
||||
unary-stream (In a single call, the client can only transmit data to the server at one time, |
||||
but the server can return the response many times.) |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def BidirectionalStreamingMethod(self, request_iterator, context): |
||||
"""双向流模式 (在一次调用中, 客户端和服务器都可以向对方多次收发数据) |
||||
stream-stream (In a single call, both client and server can send and receive data |
||||
to each other multiple times.) |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
|
||||
def add_GRPCDemoServicer_to_server(servicer, server): |
||||
rpc_method_handlers = { |
||||
'SimpleMethod': grpc.unary_unary_rpc_method_handler( |
||||
servicer.SimpleMethod, |
||||
request_deserializer=demo__pb2.Request.FromString, |
||||
response_serializer=demo__pb2.Response.SerializeToString, |
||||
), |
||||
'ClientStreamingMethod': grpc.stream_unary_rpc_method_handler( |
||||
servicer.ClientStreamingMethod, |
||||
request_deserializer=demo__pb2.Request.FromString, |
||||
response_serializer=demo__pb2.Response.SerializeToString, |
||||
), |
||||
'ServerStreamingMethod': grpc.unary_stream_rpc_method_handler( |
||||
servicer.ServerStreamingMethod, |
||||
request_deserializer=demo__pb2.Request.FromString, |
||||
response_serializer=demo__pb2.Response.SerializeToString, |
||||
), |
||||
'BidirectionalStreamingMethod': grpc.stream_stream_rpc_method_handler( |
||||
servicer.BidirectionalStreamingMethod, |
||||
request_deserializer=demo__pb2.Request.FromString, |
||||
response_serializer=demo__pb2.Response.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'demo.GRPCDemo', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
rpc_method_handlers = { |
||||
'SimpleMethod': grpc.unary_unary_rpc_method_handler( |
||||
servicer.SimpleMethod, |
||||
request_deserializer=demo__pb2.Request.FromString, |
||||
response_serializer=demo__pb2.Response.SerializeToString, |
||||
), |
||||
'ClientStreamingMethod': grpc.stream_unary_rpc_method_handler( |
||||
servicer.ClientStreamingMethod, |
||||
request_deserializer=demo__pb2.Request.FromString, |
||||
response_serializer=demo__pb2.Response.SerializeToString, |
||||
), |
||||
'ServerStreamingMethod': grpc.unary_stream_rpc_method_handler( |
||||
servicer.ServerStreamingMethod, |
||||
request_deserializer=demo__pb2.Request.FromString, |
||||
response_serializer=demo__pb2.Response.SerializeToString, |
||||
), |
||||
'BidirectionalStreamingMethod': grpc.stream_stream_rpc_method_handler( |
||||
servicer.BidirectionalStreamingMethod, |
||||
request_deserializer=demo__pb2.Request.FromString, |
||||
response_serializer=demo__pb2.Response.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'demo.GRPCDemo', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
|
||||
|
||||
# This class is part of an EXPERIMENTAL API. |
||||
class GRPCDemo(object): |
||||
"""`service` 是用来给gRPC服务定义方法的, 格式固定, 类似于Golang中定义一个接口 |
||||
`service` is used to define methods for gRPC services in a fixed format, similar to defining |
||||
an interface in Golang |
||||
""" |
||||
|
||||
@staticmethod |
||||
def SimpleMethod(request, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.unary_unary(request, target, '/demo.GRPCDemo/SimpleMethod', |
||||
demo__pb2.Request.SerializeToString, |
||||
demo__pb2.Response.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
||||
@staticmethod |
||||
def ClientStreamingMethod(request_iterator, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.stream_unary(request_iterator, target, '/demo.GRPCDemo/ClientStreamingMethod', |
||||
demo__pb2.Request.SerializeToString, |
||||
demo__pb2.Response.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
||||
@staticmethod |
||||
def ServerStreamingMethod(request, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.unary_stream(request, target, '/demo.GRPCDemo/ServerStreamingMethod', |
||||
demo__pb2.Request.SerializeToString, |
||||
demo__pb2.Response.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
||||
@staticmethod |
||||
def BidirectionalStreamingMethod(request_iterator, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.stream_stream(request_iterator, target, '/demo.GRPCDemo/BidirectionalStreamingMethod', |
||||
demo__pb2.Request.SerializeToString, |
||||
demo__pb2.Response.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
@ -0,0 +1,19 @@ |
||||
from google.protobuf import descriptor as _descriptor |
||||
from google.protobuf import message as _message |
||||
from typing import ClassVar as _ClassVar, Optional as _Optional |
||||
|
||||
DESCRIPTOR: _descriptor.FileDescriptor |
||||
|
||||
class HelloReply(_message.Message): |
||||
__slots__ = ["message"] |
||||
MESSAGE_FIELD_NUMBER: _ClassVar[int] |
||||
message: str |
||||
def __init__(self, message: _Optional[str] = ...) -> None: ... |
||||
|
||||
class HelloRequest(_message.Message): |
||||
__slots__ = ["name", "num_greetings"] |
||||
NAME_FIELD_NUMBER: _ClassVar[int] |
||||
NUM_GREETINGS_FIELD_NUMBER: _ClassVar[int] |
||||
name: str |
||||
num_greetings: str |
||||
def __init__(self, name: _Optional[str] = ..., num_greetings: _Optional[str] = ...) -> None: ... |
@ -0,0 +1,17 @@ |
||||
from google.protobuf import descriptor as _descriptor |
||||
from google.protobuf import message as _message |
||||
from typing import ClassVar as _ClassVar, Optional as _Optional |
||||
|
||||
DESCRIPTOR: _descriptor.FileDescriptor |
||||
|
||||
class HelloReply(_message.Message): |
||||
__slots__ = ["message"] |
||||
MESSAGE_FIELD_NUMBER: _ClassVar[int] |
||||
message: str |
||||
def __init__(self, message: _Optional[str] = ...) -> None: ... |
||||
|
||||
class HelloRequest(_message.Message): |
||||
__slots__ = ["name"] |
||||
NAME_FIELD_NUMBER: _ClassVar[int] |
||||
name: str |
||||
def __init__(self, name: _Optional[str] = ...) -> None: ... |
@ -1,46 +1,70 @@ |
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! |
||||
"""Client and server classes corresponding to protobuf-defined services.""" |
||||
import grpc |
||||
|
||||
import helloworld_pb2 as helloworld__pb2 |
||||
|
||||
|
||||
class GreeterStub(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
|
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.SayHello = channel.unary_unary( |
||||
'/helloworld.Greeter/SayHello', |
||||
request_serializer=helloworld__pb2.HelloRequest.SerializeToString, |
||||
response_deserializer=helloworld__pb2.HelloReply.FromString, |
||||
) |
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.SayHello = channel.unary_unary( |
||||
'/helloworld.Greeter/SayHello', |
||||
request_serializer=helloworld__pb2.HelloRequest.SerializeToString, |
||||
response_deserializer=helloworld__pb2.HelloReply.FromString, |
||||
) |
||||
|
||||
|
||||
class GreeterServicer(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
def SayHello(self, request, context): |
||||
"""Sends a greeting |
||||
"""The greeting service definition. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def SayHello(self, request, context): |
||||
"""Sends a greeting |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
|
||||
def add_GreeterServicer_to_server(servicer, server): |
||||
rpc_method_handlers = { |
||||
'SayHello': grpc.unary_unary_rpc_method_handler( |
||||
servicer.SayHello, |
||||
request_deserializer=helloworld__pb2.HelloRequest.FromString, |
||||
response_serializer=helloworld__pb2.HelloReply.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'helloworld.Greeter', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
rpc_method_handlers = { |
||||
'SayHello': grpc.unary_unary_rpc_method_handler( |
||||
servicer.SayHello, |
||||
request_deserializer=helloworld__pb2.HelloRequest.FromString, |
||||
response_serializer=helloworld__pb2.HelloReply.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'helloworld.Greeter', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
|
||||
|
||||
# This class is part of an EXPERIMENTAL API. |
||||
class Greeter(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
@staticmethod |
||||
def SayHello(request, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.unary_unary(request, target, '/helloworld.Greeter/SayHello', |
||||
helloworld__pb2.HelloRequest.SerializeToString, |
||||
helloworld__pb2.HelloReply.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
@ -0,0 +1,17 @@ |
||||
from google.protobuf import descriptor as _descriptor |
||||
from google.protobuf import message as _message |
||||
from typing import ClassVar as _ClassVar, Optional as _Optional |
||||
|
||||
DESCRIPTOR: _descriptor.FileDescriptor |
||||
|
||||
class HelloReply(_message.Message): |
||||
__slots__ = ["message"] |
||||
MESSAGE_FIELD_NUMBER: _ClassVar[int] |
||||
message: str |
||||
def __init__(self, message: _Optional[str] = ...) -> None: ... |
||||
|
||||
class HelloRequest(_message.Message): |
||||
__slots__ = ["name"] |
||||
NAME_FIELD_NUMBER: _ClassVar[int] |
||||
name: str |
||||
def __init__(self, name: _Optional[str] = ...) -> None: ... |
@ -1,46 +1,70 @@ |
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! |
||||
"""Client and server classes corresponding to protobuf-defined services.""" |
||||
import grpc |
||||
|
||||
import helloworld_pb2 as helloworld__pb2 |
||||
|
||||
|
||||
class GreeterStub(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
|
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.SayHello = channel.unary_unary( |
||||
'/helloworld.Greeter/SayHello', |
||||
request_serializer=helloworld__pb2.HelloRequest.SerializeToString, |
||||
response_deserializer=helloworld__pb2.HelloReply.FromString, |
||||
) |
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.SayHello = channel.unary_unary( |
||||
'/helloworld.Greeter/SayHello', |
||||
request_serializer=helloworld__pb2.HelloRequest.SerializeToString, |
||||
response_deserializer=helloworld__pb2.HelloReply.FromString, |
||||
) |
||||
|
||||
|
||||
class GreeterServicer(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
def SayHello(self, request, context): |
||||
"""Sends a greeting |
||||
"""The greeting service definition. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def SayHello(self, request, context): |
||||
"""Sends a greeting |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
|
||||
def add_GreeterServicer_to_server(servicer, server): |
||||
rpc_method_handlers = { |
||||
'SayHello': grpc.unary_unary_rpc_method_handler( |
||||
servicer.SayHello, |
||||
request_deserializer=helloworld__pb2.HelloRequest.FromString, |
||||
response_serializer=helloworld__pb2.HelloReply.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'helloworld.Greeter', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
rpc_method_handlers = { |
||||
'SayHello': grpc.unary_unary_rpc_method_handler( |
||||
servicer.SayHello, |
||||
request_deserializer=helloworld__pb2.HelloRequest.FromString, |
||||
response_serializer=helloworld__pb2.HelloReply.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'helloworld.Greeter', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
|
||||
|
||||
# This class is part of an EXPERIMENTAL API. |
||||
class Greeter(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
@staticmethod |
||||
def SayHello(request, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.unary_unary(request, target, '/helloworld.Greeter/SayHello', |
||||
helloworld__pb2.HelloRequest.SerializeToString, |
||||
helloworld__pb2.HelloReply.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
@ -0,0 +1,17 @@ |
||||
from google.protobuf import descriptor as _descriptor |
||||
from google.protobuf import message as _message |
||||
from typing import ClassVar as _ClassVar, Optional as _Optional |
||||
|
||||
DESCRIPTOR: _descriptor.FileDescriptor |
||||
|
||||
class HelloReply(_message.Message): |
||||
__slots__ = ["message"] |
||||
MESSAGE_FIELD_NUMBER: _ClassVar[int] |
||||
message: str |
||||
def __init__(self, message: _Optional[str] = ...) -> None: ... |
||||
|
||||
class HelloRequest(_message.Message): |
||||
__slots__ = ["name"] |
||||
NAME_FIELD_NUMBER: _ClassVar[int] |
||||
name: str |
||||
def __init__(self, name: _Optional[str] = ...) -> None: ... |
@ -1,46 +1,70 @@ |
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! |
||||
"""Client and server classes corresponding to protobuf-defined services.""" |
||||
import grpc |
||||
|
||||
import helloworld_pb2 as helloworld__pb2 |
||||
|
||||
|
||||
class GreeterStub(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
|
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.SayHello = channel.unary_unary( |
||||
'/helloworld.Greeter/SayHello', |
||||
request_serializer=helloworld__pb2.HelloRequest.SerializeToString, |
||||
response_deserializer=helloworld__pb2.HelloReply.FromString, |
||||
) |
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.SayHello = channel.unary_unary( |
||||
'/helloworld.Greeter/SayHello', |
||||
request_serializer=helloworld__pb2.HelloRequest.SerializeToString, |
||||
response_deserializer=helloworld__pb2.HelloReply.FromString, |
||||
) |
||||
|
||||
|
||||
class GreeterServicer(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
def SayHello(self, request, context): |
||||
"""Sends a greeting |
||||
"""The greeting service definition. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def SayHello(self, request, context): |
||||
"""Sends a greeting |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
|
||||
def add_GreeterServicer_to_server(servicer, server): |
||||
rpc_method_handlers = { |
||||
'SayHello': grpc.unary_unary_rpc_method_handler( |
||||
servicer.SayHello, |
||||
request_deserializer=helloworld__pb2.HelloRequest.FromString, |
||||
response_serializer=helloworld__pb2.HelloReply.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'helloworld.Greeter', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
rpc_method_handlers = { |
||||
'SayHello': grpc.unary_unary_rpc_method_handler( |
||||
servicer.SayHello, |
||||
request_deserializer=helloworld__pb2.HelloRequest.FromString, |
||||
response_serializer=helloworld__pb2.HelloReply.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'helloworld.Greeter', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
|
||||
|
||||
# This class is part of an EXPERIMENTAL API. |
||||
class Greeter(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
@staticmethod |
||||
def SayHello(request, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.unary_unary(request, target, '/helloworld.Greeter/SayHello', |
||||
helloworld__pb2.HelloRequest.SerializeToString, |
||||
helloworld__pb2.HelloReply.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
@ -0,0 +1,17 @@ |
||||
from google.protobuf import descriptor as _descriptor |
||||
from google.protobuf import message as _message |
||||
from typing import ClassVar as _ClassVar, Optional as _Optional |
||||
|
||||
DESCRIPTOR: _descriptor.FileDescriptor |
||||
|
||||
class HelloReply(_message.Message): |
||||
__slots__ = ["message"] |
||||
MESSAGE_FIELD_NUMBER: _ClassVar[int] |
||||
message: str |
||||
def __init__(self, message: _Optional[str] = ...) -> None: ... |
||||
|
||||
class HelloRequest(_message.Message): |
||||
__slots__ = ["name"] |
||||
NAME_FIELD_NUMBER: _ClassVar[int] |
||||
name: str |
||||
def __init__(self, name: _Optional[str] = ...) -> None: ... |
@ -1,46 +1,70 @@ |
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! |
||||
"""Client and server classes corresponding to protobuf-defined services.""" |
||||
import grpc |
||||
|
||||
import helloworld_pb2 as helloworld__pb2 |
||||
|
||||
|
||||
class GreeterStub(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
|
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.SayHello = channel.unary_unary( |
||||
'/helloworld.Greeter/SayHello', |
||||
request_serializer=helloworld__pb2.HelloRequest.SerializeToString, |
||||
response_deserializer=helloworld__pb2.HelloReply.FromString, |
||||
) |
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.SayHello = channel.unary_unary( |
||||
'/helloworld.Greeter/SayHello', |
||||
request_serializer=helloworld__pb2.HelloRequest.SerializeToString, |
||||
response_deserializer=helloworld__pb2.HelloReply.FromString, |
||||
) |
||||
|
||||
|
||||
class GreeterServicer(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
def SayHello(self, request, context): |
||||
"""Sends a greeting |
||||
"""The greeting service definition. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def SayHello(self, request, context): |
||||
"""Sends a greeting |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
|
||||
def add_GreeterServicer_to_server(servicer, server): |
||||
rpc_method_handlers = { |
||||
'SayHello': grpc.unary_unary_rpc_method_handler( |
||||
servicer.SayHello, |
||||
request_deserializer=helloworld__pb2.HelloRequest.FromString, |
||||
response_serializer=helloworld__pb2.HelloReply.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'helloworld.Greeter', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
rpc_method_handlers = { |
||||
'SayHello': grpc.unary_unary_rpc_method_handler( |
||||
servicer.SayHello, |
||||
request_deserializer=helloworld__pb2.HelloRequest.FromString, |
||||
response_serializer=helloworld__pb2.HelloReply.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'helloworld.Greeter', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
|
||||
|
||||
# This class is part of an EXPERIMENTAL API. |
||||
class Greeter(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
@staticmethod |
||||
def SayHello(request, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.unary_unary(request, target, '/helloworld.Greeter/SayHello', |
||||
helloworld__pb2.HelloRequest.SerializeToString, |
||||
helloworld__pb2.HelloReply.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
@ -0,0 +1,17 @@ |
||||
from google.protobuf import descriptor as _descriptor |
||||
from google.protobuf import message as _message |
||||
from typing import ClassVar as _ClassVar, Optional as _Optional |
||||
|
||||
DESCRIPTOR: _descriptor.FileDescriptor |
||||
|
||||
class HelloReply(_message.Message): |
||||
__slots__ = ["message"] |
||||
MESSAGE_FIELD_NUMBER: _ClassVar[int] |
||||
message: str |
||||
def __init__(self, message: _Optional[str] = ...) -> None: ... |
||||
|
||||
class HelloRequest(_message.Message): |
||||
__slots__ = ["name"] |
||||
NAME_FIELD_NUMBER: _ClassVar[int] |
||||
name: str |
||||
def __init__(self, name: _Optional[str] = ...) -> None: ... |
@ -1,46 +1,70 @@ |
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! |
||||
"""Client and server classes corresponding to protobuf-defined services.""" |
||||
import grpc |
||||
|
||||
import helloworld_pb2 as helloworld__pb2 |
||||
|
||||
|
||||
class GreeterStub(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
|
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.SayHello = channel.unary_unary( |
||||
'/helloworld.Greeter/SayHello', |
||||
request_serializer=helloworld__pb2.HelloRequest.SerializeToString, |
||||
response_deserializer=helloworld__pb2.HelloReply.FromString, |
||||
) |
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.SayHello = channel.unary_unary( |
||||
'/helloworld.Greeter/SayHello', |
||||
request_serializer=helloworld__pb2.HelloRequest.SerializeToString, |
||||
response_deserializer=helloworld__pb2.HelloReply.FromString, |
||||
) |
||||
|
||||
|
||||
class GreeterServicer(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
def SayHello(self, request, context): |
||||
"""Sends a greeting |
||||
"""The greeting service definition. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def SayHello(self, request, context): |
||||
"""Sends a greeting |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
|
||||
def add_GreeterServicer_to_server(servicer, server): |
||||
rpc_method_handlers = { |
||||
'SayHello': grpc.unary_unary_rpc_method_handler( |
||||
servicer.SayHello, |
||||
request_deserializer=helloworld__pb2.HelloRequest.FromString, |
||||
response_serializer=helloworld__pb2.HelloReply.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'helloworld.Greeter', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
rpc_method_handlers = { |
||||
'SayHello': grpc.unary_unary_rpc_method_handler( |
||||
servicer.SayHello, |
||||
request_deserializer=helloworld__pb2.HelloRequest.FromString, |
||||
response_serializer=helloworld__pb2.HelloReply.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'helloworld.Greeter', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
|
||||
|
||||
# This class is part of an EXPERIMENTAL API. |
||||
class Greeter(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
@staticmethod |
||||
def SayHello(request, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.unary_unary(request, target, '/helloworld.Greeter/SayHello', |
||||
helloworld__pb2.HelloRequest.SerializeToString, |
||||
helloworld__pb2.HelloReply.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
@ -0,0 +1,49 @@ |
||||
from google.protobuf import descriptor as _descriptor |
||||
from google.protobuf import message as _message |
||||
from typing import ClassVar as _ClassVar, Mapping as _Mapping, Optional as _Optional, Union as _Union |
||||
|
||||
DESCRIPTOR: _descriptor.FileDescriptor |
||||
|
||||
class Feature(_message.Message): |
||||
__slots__ = ["location", "name"] |
||||
LOCATION_FIELD_NUMBER: _ClassVar[int] |
||||
NAME_FIELD_NUMBER: _ClassVar[int] |
||||
location: Point |
||||
name: str |
||||
def __init__(self, name: _Optional[str] = ..., location: _Optional[_Union[Point, _Mapping]] = ...) -> None: ... |
||||
|
||||
class Point(_message.Message): |
||||
__slots__ = ["latitude", "longitude"] |
||||
LATITUDE_FIELD_NUMBER: _ClassVar[int] |
||||
LONGITUDE_FIELD_NUMBER: _ClassVar[int] |
||||
latitude: int |
||||
longitude: int |
||||
def __init__(self, latitude: _Optional[int] = ..., longitude: _Optional[int] = ...) -> None: ... |
||||
|
||||
class Rectangle(_message.Message): |
||||
__slots__ = ["hi", "lo"] |
||||
HI_FIELD_NUMBER: _ClassVar[int] |
||||
LO_FIELD_NUMBER: _ClassVar[int] |
||||
hi: Point |
||||
lo: Point |
||||
def __init__(self, lo: _Optional[_Union[Point, _Mapping]] = ..., hi: _Optional[_Union[Point, _Mapping]] = ...) -> None: ... |
||||
|
||||
class RouteNote(_message.Message): |
||||
__slots__ = ["location", "message"] |
||||
LOCATION_FIELD_NUMBER: _ClassVar[int] |
||||
MESSAGE_FIELD_NUMBER: _ClassVar[int] |
||||
location: Point |
||||
message: str |
||||
def __init__(self, location: _Optional[_Union[Point, _Mapping]] = ..., message: _Optional[str] = ...) -> None: ... |
||||
|
||||
class RouteSummary(_message.Message): |
||||
__slots__ = ["distance", "elapsed_time", "feature_count", "point_count"] |
||||
DISTANCE_FIELD_NUMBER: _ClassVar[int] |
||||
ELAPSED_TIME_FIELD_NUMBER: _ClassVar[int] |
||||
FEATURE_COUNT_FIELD_NUMBER: _ClassVar[int] |
||||
POINT_COUNT_FIELD_NUMBER: _ClassVar[int] |
||||
distance: int |
||||
elapsed_time: int |
||||
feature_count: int |
||||
point_count: int |
||||
def __init__(self, point_count: _Optional[int] = ..., feature_count: _Optional[int] = ..., distance: _Optional[int] = ..., elapsed_time: _Optional[int] = ...) -> None: ... |
@ -1,113 +1,188 @@ |
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! |
||||
"""Client and server classes corresponding to protobuf-defined services.""" |
||||
import grpc |
||||
|
||||
import route_guide_pb2 as route__guide__pb2 |
||||
|
||||
|
||||
class RouteGuideStub(object): |
||||
"""Interface exported by the server. |
||||
""" |
||||
|
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
|
||||
Args: |
||||
channel: A grpc.Channel. |
||||
"""Interface exported by the server. |
||||
""" |
||||
self.GetFeature = channel.unary_unary( |
||||
'/routeguide.RouteGuide/GetFeature', |
||||
request_serializer=route__guide__pb2.Point.SerializeToString, |
||||
response_deserializer=route__guide__pb2.Feature.FromString, |
||||
) |
||||
self.ListFeatures = channel.unary_stream( |
||||
'/routeguide.RouteGuide/ListFeatures', |
||||
request_serializer=route__guide__pb2.Rectangle.SerializeToString, |
||||
response_deserializer=route__guide__pb2.Feature.FromString, |
||||
) |
||||
self.RecordRoute = channel.stream_unary( |
||||
'/routeguide.RouteGuide/RecordRoute', |
||||
request_serializer=route__guide__pb2.Point.SerializeToString, |
||||
response_deserializer=route__guide__pb2.RouteSummary.FromString, |
||||
) |
||||
self.RouteChat = channel.stream_stream( |
||||
'/routeguide.RouteGuide/RouteChat', |
||||
request_serializer=route__guide__pb2.RouteNote.SerializeToString, |
||||
response_deserializer=route__guide__pb2.RouteNote.FromString, |
||||
) |
||||
|
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
|
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.GetFeature = channel.unary_unary( |
||||
'/routeguide.RouteGuide/GetFeature', |
||||
request_serializer=route__guide__pb2.Point.SerializeToString, |
||||
response_deserializer=route__guide__pb2.Feature.FromString, |
||||
) |
||||
self.ListFeatures = channel.unary_stream( |
||||
'/routeguide.RouteGuide/ListFeatures', |
||||
request_serializer=route__guide__pb2.Rectangle.SerializeToString, |
||||
response_deserializer=route__guide__pb2.Feature.FromString, |
||||
) |
||||
self.RecordRoute = channel.stream_unary( |
||||
'/routeguide.RouteGuide/RecordRoute', |
||||
request_serializer=route__guide__pb2.Point.SerializeToString, |
||||
response_deserializer=route__guide__pb2.RouteSummary.FromString, |
||||
) |
||||
self.RouteChat = channel.stream_stream( |
||||
'/routeguide.RouteGuide/RouteChat', |
||||
request_serializer=route__guide__pb2.RouteNote.SerializeToString, |
||||
response_deserializer=route__guide__pb2.RouteNote.FromString, |
||||
) |
||||
|
||||
|
||||
class RouteGuideServicer(object): |
||||
"""Interface exported by the server. |
||||
""" |
||||
"""Interface exported by the server. |
||||
""" |
||||
|
||||
def GetFeature(self, request, context): |
||||
"""A simple RPC. |
||||
def GetFeature(self, request, context): |
||||
"""A simple RPC. |
||||
|
||||
Obtains the feature at a given position. |
||||
Obtains the feature at a given position. |
||||
|
||||
A feature with an empty name is returned if there's no feature at the given |
||||
position. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
A feature with an empty name is returned if there's no feature at the given |
||||
position. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def ListFeatures(self, request, context): |
||||
"""A server-to-client streaming RPC. |
||||
def ListFeatures(self, request, context): |
||||
"""A server-to-client streaming RPC. |
||||
|
||||
Obtains the Features available within the given Rectangle. Results are |
||||
streamed rather than returned at once (e.g. in a response message with a |
||||
repeated field), as the rectangle may cover a large area and contain a |
||||
huge number of features. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
Obtains the Features available within the given Rectangle. Results are |
||||
streamed rather than returned at once (e.g. in a response message with a |
||||
repeated field), as the rectangle may cover a large area and contain a |
||||
huge number of features. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def RecordRoute(self, request_iterator, context): |
||||
"""A client-to-server streaming RPC. |
||||
def RecordRoute(self, request_iterator, context): |
||||
"""A client-to-server streaming RPC. |
||||
|
||||
Accepts a stream of Points on a route being traversed, returning a |
||||
RouteSummary when traversal is completed. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
Accepts a stream of Points on a route being traversed, returning a |
||||
RouteSummary when traversal is completed. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def RouteChat(self, request_iterator, context): |
||||
"""A Bidirectional streaming RPC. |
||||
def RouteChat(self, request_iterator, context): |
||||
"""A Bidirectional streaming RPC. |
||||
|
||||
Accepts a stream of RouteNotes sent while a route is being traversed, |
||||
while receiving other RouteNotes (e.g. from other users). |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
Accepts a stream of RouteNotes sent while a route is being traversed, |
||||
while receiving other RouteNotes (e.g. from other users). |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
|
||||
def add_RouteGuideServicer_to_server(servicer, server): |
||||
rpc_method_handlers = { |
||||
'GetFeature': grpc.unary_unary_rpc_method_handler( |
||||
servicer.GetFeature, |
||||
request_deserializer=route__guide__pb2.Point.FromString, |
||||
response_serializer=route__guide__pb2.Feature.SerializeToString, |
||||
), |
||||
'ListFeatures': grpc.unary_stream_rpc_method_handler( |
||||
servicer.ListFeatures, |
||||
request_deserializer=route__guide__pb2.Rectangle.FromString, |
||||
response_serializer=route__guide__pb2.Feature.SerializeToString, |
||||
), |
||||
'RecordRoute': grpc.stream_unary_rpc_method_handler( |
||||
servicer.RecordRoute, |
||||
request_deserializer=route__guide__pb2.Point.FromString, |
||||
response_serializer=route__guide__pb2.RouteSummary.SerializeToString, |
||||
), |
||||
'RouteChat': grpc.stream_stream_rpc_method_handler( |
||||
servicer.RouteChat, |
||||
request_deserializer=route__guide__pb2.RouteNote.FromString, |
||||
response_serializer=route__guide__pb2.RouteNote.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'routeguide.RouteGuide', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
rpc_method_handlers = { |
||||
'GetFeature': grpc.unary_unary_rpc_method_handler( |
||||
servicer.GetFeature, |
||||
request_deserializer=route__guide__pb2.Point.FromString, |
||||
response_serializer=route__guide__pb2.Feature.SerializeToString, |
||||
), |
||||
'ListFeatures': grpc.unary_stream_rpc_method_handler( |
||||
servicer.ListFeatures, |
||||
request_deserializer=route__guide__pb2.Rectangle.FromString, |
||||
response_serializer=route__guide__pb2.Feature.SerializeToString, |
||||
), |
||||
'RecordRoute': grpc.stream_unary_rpc_method_handler( |
||||
servicer.RecordRoute, |
||||
request_deserializer=route__guide__pb2.Point.FromString, |
||||
response_serializer=route__guide__pb2.RouteSummary.SerializeToString, |
||||
), |
||||
'RouteChat': grpc.stream_stream_rpc_method_handler( |
||||
servicer.RouteChat, |
||||
request_deserializer=route__guide__pb2.RouteNote.FromString, |
||||
response_serializer=route__guide__pb2.RouteNote.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'routeguide.RouteGuide', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
|
||||
|
||||
# This class is part of an EXPERIMENTAL API. |
||||
class RouteGuide(object): |
||||
"""Interface exported by the server. |
||||
""" |
||||
|
||||
@staticmethod |
||||
def GetFeature(request, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.unary_unary(request, target, '/routeguide.RouteGuide/GetFeature', |
||||
route__guide__pb2.Point.SerializeToString, |
||||
route__guide__pb2.Feature.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
||||
@staticmethod |
||||
def ListFeatures(request, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.unary_stream(request, target, '/routeguide.RouteGuide/ListFeatures', |
||||
route__guide__pb2.Rectangle.SerializeToString, |
||||
route__guide__pb2.Feature.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
||||
@staticmethod |
||||
def RecordRoute(request_iterator, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.stream_unary(request_iterator, target, '/routeguide.RouteGuide/RecordRoute', |
||||
route__guide__pb2.Point.SerializeToString, |
||||
route__guide__pb2.RouteSummary.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
||||
@staticmethod |
||||
def RouteChat(request_iterator, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.stream_stream(request_iterator, target, '/routeguide.RouteGuide/RouteChat', |
||||
route__guide__pb2.RouteNote.SerializeToString, |
||||
route__guide__pb2.RouteNote.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
@ -0,0 +1,49 @@ |
||||
from google.protobuf import descriptor as _descriptor |
||||
from google.protobuf import message as _message |
||||
from typing import ClassVar as _ClassVar, Mapping as _Mapping, Optional as _Optional, Union as _Union |
||||
|
||||
DESCRIPTOR: _descriptor.FileDescriptor |
||||
|
||||
class Feature(_message.Message): |
||||
__slots__ = ["location", "name"] |
||||
LOCATION_FIELD_NUMBER: _ClassVar[int] |
||||
NAME_FIELD_NUMBER: _ClassVar[int] |
||||
location: Point |
||||
name: str |
||||
def __init__(self, name: _Optional[str] = ..., location: _Optional[_Union[Point, _Mapping]] = ...) -> None: ... |
||||
|
||||
class Point(_message.Message): |
||||
__slots__ = ["latitude", "longitude"] |
||||
LATITUDE_FIELD_NUMBER: _ClassVar[int] |
||||
LONGITUDE_FIELD_NUMBER: _ClassVar[int] |
||||
latitude: int |
||||
longitude: int |
||||
def __init__(self, latitude: _Optional[int] = ..., longitude: _Optional[int] = ...) -> None: ... |
||||
|
||||
class Rectangle(_message.Message): |
||||
__slots__ = ["hi", "lo"] |
||||
HI_FIELD_NUMBER: _ClassVar[int] |
||||
LO_FIELD_NUMBER: _ClassVar[int] |
||||
hi: Point |
||||
lo: Point |
||||
def __init__(self, lo: _Optional[_Union[Point, _Mapping]] = ..., hi: _Optional[_Union[Point, _Mapping]] = ...) -> None: ... |
||||
|
||||
class RouteNote(_message.Message): |
||||
__slots__ = ["location", "message"] |
||||
LOCATION_FIELD_NUMBER: _ClassVar[int] |
||||
MESSAGE_FIELD_NUMBER: _ClassVar[int] |
||||
location: Point |
||||
message: str |
||||
def __init__(self, location: _Optional[_Union[Point, _Mapping]] = ..., message: _Optional[str] = ...) -> None: ... |
||||
|
||||
class RouteSummary(_message.Message): |
||||
__slots__ = ["distance", "elapsed_time", "feature_count", "point_count"] |
||||
DISTANCE_FIELD_NUMBER: _ClassVar[int] |
||||
ELAPSED_TIME_FIELD_NUMBER: _ClassVar[int] |
||||
FEATURE_COUNT_FIELD_NUMBER: _ClassVar[int] |
||||
POINT_COUNT_FIELD_NUMBER: _ClassVar[int] |
||||
distance: int |
||||
elapsed_time: int |
||||
feature_count: int |
||||
point_count: int |
||||
def __init__(self, point_count: _Optional[int] = ..., feature_count: _Optional[int] = ..., distance: _Optional[int] = ..., elapsed_time: _Optional[int] = ...) -> None: ... |
@ -1,113 +1,188 @@ |
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! |
||||
"""Client and server classes corresponding to protobuf-defined services.""" |
||||
import grpc |
||||
|
||||
import route_guide_pb2 as route__guide__pb2 |
||||
|
||||
|
||||
class RouteGuideStub(object): |
||||
"""Interface exported by the server. |
||||
""" |
||||
|
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
|
||||
Args: |
||||
channel: A grpc.Channel. |
||||
"""Interface exported by the server. |
||||
""" |
||||
self.GetFeature = channel.unary_unary( |
||||
'/routeguide.RouteGuide/GetFeature', |
||||
request_serializer=route__guide__pb2.Point.SerializeToString, |
||||
response_deserializer=route__guide__pb2.Feature.FromString, |
||||
) |
||||
self.ListFeatures = channel.unary_stream( |
||||
'/routeguide.RouteGuide/ListFeatures', |
||||
request_serializer=route__guide__pb2.Rectangle.SerializeToString, |
||||
response_deserializer=route__guide__pb2.Feature.FromString, |
||||
) |
||||
self.RecordRoute = channel.stream_unary( |
||||
'/routeguide.RouteGuide/RecordRoute', |
||||
request_serializer=route__guide__pb2.Point.SerializeToString, |
||||
response_deserializer=route__guide__pb2.RouteSummary.FromString, |
||||
) |
||||
self.RouteChat = channel.stream_stream( |
||||
'/routeguide.RouteGuide/RouteChat', |
||||
request_serializer=route__guide__pb2.RouteNote.SerializeToString, |
||||
response_deserializer=route__guide__pb2.RouteNote.FromString, |
||||
) |
||||
|
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
|
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.GetFeature = channel.unary_unary( |
||||
'/routeguide.RouteGuide/GetFeature', |
||||
request_serializer=route__guide__pb2.Point.SerializeToString, |
||||
response_deserializer=route__guide__pb2.Feature.FromString, |
||||
) |
||||
self.ListFeatures = channel.unary_stream( |
||||
'/routeguide.RouteGuide/ListFeatures', |
||||
request_serializer=route__guide__pb2.Rectangle.SerializeToString, |
||||
response_deserializer=route__guide__pb2.Feature.FromString, |
||||
) |
||||
self.RecordRoute = channel.stream_unary( |
||||
'/routeguide.RouteGuide/RecordRoute', |
||||
request_serializer=route__guide__pb2.Point.SerializeToString, |
||||
response_deserializer=route__guide__pb2.RouteSummary.FromString, |
||||
) |
||||
self.RouteChat = channel.stream_stream( |
||||
'/routeguide.RouteGuide/RouteChat', |
||||
request_serializer=route__guide__pb2.RouteNote.SerializeToString, |
||||
response_deserializer=route__guide__pb2.RouteNote.FromString, |
||||
) |
||||
|
||||
|
||||
class RouteGuideServicer(object): |
||||
"""Interface exported by the server. |
||||
""" |
||||
"""Interface exported by the server. |
||||
""" |
||||
|
||||
def GetFeature(self, request, context): |
||||
"""A simple RPC. |
||||
def GetFeature(self, request, context): |
||||
"""A simple RPC. |
||||
|
||||
Obtains the feature at a given position. |
||||
Obtains the feature at a given position. |
||||
|
||||
A feature with an empty name is returned if there's no feature at the given |
||||
position. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
A feature with an empty name is returned if there's no feature at the given |
||||
position. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def ListFeatures(self, request, context): |
||||
"""A server-to-client streaming RPC. |
||||
def ListFeatures(self, request, context): |
||||
"""A server-to-client streaming RPC. |
||||
|
||||
Obtains the Features available within the given Rectangle. Results are |
||||
streamed rather than returned at once (e.g. in a response message with a |
||||
repeated field), as the rectangle may cover a large area and contain a |
||||
huge number of features. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
Obtains the Features available within the given Rectangle. Results are |
||||
streamed rather than returned at once (e.g. in a response message with a |
||||
repeated field), as the rectangle may cover a large area and contain a |
||||
huge number of features. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def RecordRoute(self, request_iterator, context): |
||||
"""A client-to-server streaming RPC. |
||||
def RecordRoute(self, request_iterator, context): |
||||
"""A client-to-server streaming RPC. |
||||
|
||||
Accepts a stream of Points on a route being traversed, returning a |
||||
RouteSummary when traversal is completed. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
Accepts a stream of Points on a route being traversed, returning a |
||||
RouteSummary when traversal is completed. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def RouteChat(self, request_iterator, context): |
||||
"""A Bidirectional streaming RPC. |
||||
def RouteChat(self, request_iterator, context): |
||||
"""A Bidirectional streaming RPC. |
||||
|
||||
Accepts a stream of RouteNotes sent while a route is being traversed, |
||||
while receiving other RouteNotes (e.g. from other users). |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
Accepts a stream of RouteNotes sent while a route is being traversed, |
||||
while receiving other RouteNotes (e.g. from other users). |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
|
||||
def add_RouteGuideServicer_to_server(servicer, server): |
||||
rpc_method_handlers = { |
||||
'GetFeature': grpc.unary_unary_rpc_method_handler( |
||||
servicer.GetFeature, |
||||
request_deserializer=route__guide__pb2.Point.FromString, |
||||
response_serializer=route__guide__pb2.Feature.SerializeToString, |
||||
), |
||||
'ListFeatures': grpc.unary_stream_rpc_method_handler( |
||||
servicer.ListFeatures, |
||||
request_deserializer=route__guide__pb2.Rectangle.FromString, |
||||
response_serializer=route__guide__pb2.Feature.SerializeToString, |
||||
), |
||||
'RecordRoute': grpc.stream_unary_rpc_method_handler( |
||||
servicer.RecordRoute, |
||||
request_deserializer=route__guide__pb2.Point.FromString, |
||||
response_serializer=route__guide__pb2.RouteSummary.SerializeToString, |
||||
), |
||||
'RouteChat': grpc.stream_stream_rpc_method_handler( |
||||
servicer.RouteChat, |
||||
request_deserializer=route__guide__pb2.RouteNote.FromString, |
||||
response_serializer=route__guide__pb2.RouteNote.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'routeguide.RouteGuide', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
rpc_method_handlers = { |
||||
'GetFeature': grpc.unary_unary_rpc_method_handler( |
||||
servicer.GetFeature, |
||||
request_deserializer=route__guide__pb2.Point.FromString, |
||||
response_serializer=route__guide__pb2.Feature.SerializeToString, |
||||
), |
||||
'ListFeatures': grpc.unary_stream_rpc_method_handler( |
||||
servicer.ListFeatures, |
||||
request_deserializer=route__guide__pb2.Rectangle.FromString, |
||||
response_serializer=route__guide__pb2.Feature.SerializeToString, |
||||
), |
||||
'RecordRoute': grpc.stream_unary_rpc_method_handler( |
||||
servicer.RecordRoute, |
||||
request_deserializer=route__guide__pb2.Point.FromString, |
||||
response_serializer=route__guide__pb2.RouteSummary.SerializeToString, |
||||
), |
||||
'RouteChat': grpc.stream_stream_rpc_method_handler( |
||||
servicer.RouteChat, |
||||
request_deserializer=route__guide__pb2.RouteNote.FromString, |
||||
response_serializer=route__guide__pb2.RouteNote.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'routeguide.RouteGuide', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
|
||||
|
||||
# This class is part of an EXPERIMENTAL API. |
||||
class RouteGuide(object): |
||||
"""Interface exported by the server. |
||||
""" |
||||
|
||||
@staticmethod |
||||
def GetFeature(request, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.unary_unary(request, target, '/routeguide.RouteGuide/GetFeature', |
||||
route__guide__pb2.Point.SerializeToString, |
||||
route__guide__pb2.Feature.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
||||
@staticmethod |
||||
def ListFeatures(request, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.unary_stream(request, target, '/routeguide.RouteGuide/ListFeatures', |
||||
route__guide__pb2.Rectangle.SerializeToString, |
||||
route__guide__pb2.Feature.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
||||
@staticmethod |
||||
def RecordRoute(request_iterator, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.stream_unary(request_iterator, target, '/routeguide.RouteGuide/RecordRoute', |
||||
route__guide__pb2.Point.SerializeToString, |
||||
route__guide__pb2.RouteSummary.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
||||
@staticmethod |
||||
def RouteChat(request_iterator, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.stream_stream(request_iterator, target, '/routeguide.RouteGuide/RouteChat', |
||||
route__guide__pb2.RouteNote.SerializeToString, |
||||
route__guide__pb2.RouteNote.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
@ -0,0 +1,17 @@ |
||||
from google.protobuf import descriptor as _descriptor |
||||
from google.protobuf import message as _message |
||||
from typing import ClassVar as _ClassVar, Optional as _Optional |
||||
|
||||
DESCRIPTOR: _descriptor.FileDescriptor |
||||
|
||||
class HelloReply(_message.Message): |
||||
__slots__ = ["message"] |
||||
MESSAGE_FIELD_NUMBER: _ClassVar[int] |
||||
message: str |
||||
def __init__(self, message: _Optional[str] = ...) -> None: ... |
||||
|
||||
class HelloRequest(_message.Message): |
||||
__slots__ = ["name"] |
||||
NAME_FIELD_NUMBER: _ClassVar[int] |
||||
name: str |
||||
def __init__(self, name: _Optional[str] = ...) -> None: ... |
@ -1,46 +1,70 @@ |
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! |
||||
"""Client and server classes corresponding to protobuf-defined services.""" |
||||
import grpc |
||||
|
||||
import helloworld_pb2 as helloworld__pb2 |
||||
|
||||
|
||||
class GreeterStub(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
|
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.SayHello = channel.unary_unary( |
||||
'/helloworld.Greeter/SayHello', |
||||
request_serializer=helloworld__pb2.HelloRequest.SerializeToString, |
||||
response_deserializer=helloworld__pb2.HelloReply.FromString, |
||||
) |
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.SayHello = channel.unary_unary( |
||||
'/helloworld.Greeter/SayHello', |
||||
request_serializer=helloworld__pb2.HelloRequest.SerializeToString, |
||||
response_deserializer=helloworld__pb2.HelloReply.FromString, |
||||
) |
||||
|
||||
|
||||
class GreeterServicer(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
def SayHello(self, request, context): |
||||
"""Sends a greeting |
||||
"""The greeting service definition. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def SayHello(self, request, context): |
||||
"""Sends a greeting |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
|
||||
def add_GreeterServicer_to_server(servicer, server): |
||||
rpc_method_handlers = { |
||||
'SayHello': grpc.unary_unary_rpc_method_handler( |
||||
servicer.SayHello, |
||||
request_deserializer=helloworld__pb2.HelloRequest.FromString, |
||||
response_serializer=helloworld__pb2.HelloReply.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'helloworld.Greeter', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
rpc_method_handlers = { |
||||
'SayHello': grpc.unary_unary_rpc_method_handler( |
||||
servicer.SayHello, |
||||
request_deserializer=helloworld__pb2.HelloRequest.FromString, |
||||
response_serializer=helloworld__pb2.HelloReply.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'helloworld.Greeter', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
|
||||
|
||||
# This class is part of an EXPERIMENTAL API. |
||||
class Greeter(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
@staticmethod |
||||
def SayHello(request, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.unary_unary(request, target, '/helloworld.Greeter/SayHello', |
||||
helloworld__pb2.HelloRequest.SerializeToString, |
||||
helloworld__pb2.HelloReply.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
@ -0,0 +1,17 @@ |
||||
from google.protobuf import descriptor as _descriptor |
||||
from google.protobuf import message as _message |
||||
from typing import ClassVar as _ClassVar, Optional as _Optional |
||||
|
||||
DESCRIPTOR: _descriptor.FileDescriptor |
||||
|
||||
class HelloReply(_message.Message): |
||||
__slots__ = ["message"] |
||||
MESSAGE_FIELD_NUMBER: _ClassVar[int] |
||||
message: str |
||||
def __init__(self, message: _Optional[str] = ...) -> None: ... |
||||
|
||||
class HelloRequest(_message.Message): |
||||
__slots__ = ["name"] |
||||
NAME_FIELD_NUMBER: _ClassVar[int] |
||||
name: str |
||||
def __init__(self, name: _Optional[str] = ...) -> None: ... |
@ -1,46 +1,70 @@ |
||||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! |
||||
"""Client and server classes corresponding to protobuf-defined services.""" |
||||
import grpc |
||||
|
||||
import helloworld_pb2 as helloworld__pb2 |
||||
|
||||
|
||||
class GreeterStub(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
def __init__(self, channel): |
||||
"""Constructor. |
||||
|
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.SayHello = channel.unary_unary( |
||||
'/helloworld.Greeter/SayHello', |
||||
request_serializer=helloworld__pb2.HelloRequest.SerializeToString, |
||||
response_deserializer=helloworld__pb2.HelloReply.FromString, |
||||
) |
||||
Args: |
||||
channel: A grpc.Channel. |
||||
""" |
||||
self.SayHello = channel.unary_unary( |
||||
'/helloworld.Greeter/SayHello', |
||||
request_serializer=helloworld__pb2.HelloRequest.SerializeToString, |
||||
response_deserializer=helloworld__pb2.HelloReply.FromString, |
||||
) |
||||
|
||||
|
||||
class GreeterServicer(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
def SayHello(self, request, context): |
||||
"""Sends a greeting |
||||
"""The greeting service definition. |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
def SayHello(self, request, context): |
||||
"""Sends a greeting |
||||
""" |
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
||||
context.set_details('Method not implemented!') |
||||
raise NotImplementedError('Method not implemented!') |
||||
|
||||
|
||||
def add_GreeterServicer_to_server(servicer, server): |
||||
rpc_method_handlers = { |
||||
'SayHello': grpc.unary_unary_rpc_method_handler( |
||||
servicer.SayHello, |
||||
request_deserializer=helloworld__pb2.HelloRequest.FromString, |
||||
response_serializer=helloworld__pb2.HelloReply.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'helloworld.Greeter', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
rpc_method_handlers = { |
||||
'SayHello': grpc.unary_unary_rpc_method_handler( |
||||
servicer.SayHello, |
||||
request_deserializer=helloworld__pb2.HelloRequest.FromString, |
||||
response_serializer=helloworld__pb2.HelloReply.SerializeToString, |
||||
), |
||||
} |
||||
generic_handler = grpc.method_handlers_generic_handler( |
||||
'helloworld.Greeter', rpc_method_handlers) |
||||
server.add_generic_rpc_handlers((generic_handler,)) |
||||
|
||||
|
||||
# This class is part of an EXPERIMENTAL API. |
||||
class Greeter(object): |
||||
"""The greeting service definition. |
||||
""" |
||||
|
||||
@staticmethod |
||||
def SayHello(request, |
||||
target, |
||||
options=(), |
||||
channel_credentials=None, |
||||
call_credentials=None, |
||||
insecure=False, |
||||
compression=None, |
||||
wait_for_ready=None, |
||||
timeout=None, |
||||
metadata=None): |
||||
return grpc.experimental.unary_unary(request, target, '/helloworld.Greeter/SayHello', |
||||
helloworld__pb2.HelloRequest.SerializeToString, |
||||
helloworld__pb2.HelloReply.FromString, |
||||
options, channel_credentials, |
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
||||
|
@ -1,6 +1,6 @@ |
||||
# GRPC Python setup requirements |
||||
coverage>=4.0 |
||||
cython>=0.29.8 |
||||
protobuf>=3.5.0.post1, < 4.0dev |
||||
protobuf>=4.21.3,<5.0dev |
||||
six>=1.10 |
||||
wheel>=0.29 |
||||
|
@ -1 +1 @@ |
||||
Subproject commit 22d0e265de7d2b3d2e9a00d071313502e7d4cccf |
||||
Subproject commit c9869dc7803eb0a21d7e589c40ff4f9288cd34ae |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue