python tinode_grpc updated

This commit is contained in:
or-else
2022-02-17 18:02:49 -08:00
parent 0a2f0d2fb7
commit d0a836ee3c
4 changed files with 636 additions and 3393 deletions

View File

@ -5,7 +5,7 @@ echo "Packaging python tinode-grpc..."
pushd ./pbx > /dev/null
# Generate grpc bindings from the proto file.
./generate-python.sh v=3
./py-generate.sh v=3
pushd ../py_grpc > /dev/null

View File

@ -17,7 +17,7 @@ pip install tinode_grpc
## Generating files
Don't modify included files directly. If you want to make changes, you have to install protobuffers tool chain and gRPC the generate the Python bindings from [`pbx/model.proto`](https://github.com/tinode/chat/tree/master/pbx/model.proto) (your path to `model.proto` may be different):
Don't modify included files directly. If you want to make changes, you have to install protobuffers tool chain and gRPC then generate the Python bindings from [`pbx/model.proto`](https://github.com/tinode/chat/tree/master/pbx/model.proto) (your path to `model.proto` may be different):
```
python -m grpc_tools.protoc -I../pbx --python_out=. --grpc_python_out=. ../pbx/model.proto
```

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,5 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from . import model_pb2 as model__pb2
@ -46,6 +47,29 @@ def add_NodeServicer_to_server(servicer, server):
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class Node(object):
"""This is the single method that needs to be implemented by a gRPC client.
"""
@staticmethod
def MessageLoop(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, '/pbx.Node/MessageLoop',
model__pb2.ClientMsg.SerializeToString,
model__pb2.ServerMsg.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
class PluginStub(object):
"""Plugin interface.
"""
@ -178,3 +202,111 @@ def add_PluginServicer_to_server(servicer, server):
generic_handler = grpc.method_handlers_generic_handler(
'pbx.Plugin', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class Plugin(object):
"""Plugin interface.
"""
@staticmethod
def FireHose(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, '/pbx.Plugin/FireHose',
model__pb2.ClientReq.SerializeToString,
model__pb2.ServerResp.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Find(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, '/pbx.Plugin/Find',
model__pb2.SearchQuery.SerializeToString,
model__pb2.SearchFound.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Account(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, '/pbx.Plugin/Account',
model__pb2.AccountEvent.SerializeToString,
model__pb2.Unused.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Topic(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, '/pbx.Plugin/Topic',
model__pb2.TopicEvent.SerializeToString,
model__pb2.Unused.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Subscription(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, '/pbx.Plugin/Subscription',
model__pb2.SubscriptionEvent.SerializeToString,
model__pb2.Unused.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Message(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, '/pbx.Plugin/Message',
model__pb2.MessageEvent.SerializeToString,
model__pb2.Unused.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)