good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
chat
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
github
tinode
chat
Commits
c7a491e1
Commit
c7a491e1
authored
1 year ago
by
or-else
Browse files
Options
Downloads
Patches
Plain Diff
regenerated python gRPC files
parent
8a8b153b
No related branches found
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
py_grpc/tinode_grpc/model_pb2.py
+0
-0
0 additions, 0 deletions
py_grpc/tinode_grpc/model_pb2.py
py_grpc/tinode_grpc/model_pb2_grpc.py
+278
-146
278 additions, 146 deletions
py_grpc/tinode_grpc/model_pb2_grpc.py
with
278 additions
and
146 deletions
py_grpc/tinode_grpc/model_pb2.py
-121.98 KiB (-87%)
View file @
c7a491e1
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
This diff is collapsed.
Click to expand it.
py_grpc/tinode_grpc/model_pb2_grpc.py
+
278
−
146
View file @
c7a491e1
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""
Client and server classes corresponding to protobuf-defined services.
"""
import
grpc
import
grpc
from
.
import
model_pb2
as
model__pb2
from
.
import
model_pb2
as
model__pb2
class
NodeStub
(
object
):
class
NodeStub
(
object
):
"""
This is the single method that needs to be implemented by a gRPC client.
"""
This is the single method that needs to be implemented by a gRPC client.
"""
"""
def
__init__
(
self
,
channel
):
def
__init__
(
self
,
channel
):
"""
Constructor.
"""
Constructor.
Args:
Args:
channel: A grpc.Channel.
channel: A grpc.Channel.
"""
"""
self
.
MessageLoop
=
channel
.
stream_stream
(
self
.
MessageLoop
=
channel
.
stream_stream
(
'
/pbx.Node/MessageLoop
'
,
'
/pbx.Node/MessageLoop
'
,
request_serializer
=
model__pb2
.
ClientMsg
.
SerializeToString
,
request_serializer
=
model__pb2
.
ClientMsg
.
SerializeToString
,
response_deserializer
=
model__pb2
.
ServerMsg
.
FromString
,
response_deserializer
=
model__pb2
.
ServerMsg
.
FromString
,
)
)
class
NodeServicer
(
object
):
class
NodeServicer
(
object
):
"""
This is the single method that needs to be implemented by a gRPC client.
"""
This is the single method that needs to be implemented by a gRPC client.
"""
def
MessageLoop
(
self
,
request_iterator
,
context
):
"""
Client sends a stream of ClientMsg, server responds with a stream of ServerMsg
"""
"""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'
Method not implemented!
'
)
def
MessageLoop
(
self
,
request_iterator
,
context
):
raise
NotImplementedError
(
'
Method not implemented!
'
)
"""
Client sends a stream of ClientMsg, server responds with a stream of ServerMsg
"""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'
Method not implemented!
'
)
raise
NotImplementedError
(
'
Method not implemented!
'
)
def
add_NodeServicer_to_server
(
servicer
,
server
):
def
add_NodeServicer_to_server
(
servicer
,
server
):
rpc_method_handlers
=
{
rpc_method_handlers
=
{
'
MessageLoop
'
:
grpc
.
stream_stream_rpc_method_handler
(
'
MessageLoop
'
:
grpc
.
stream_stream_rpc_method_handler
(
servicer
.
MessageLoop
,
servicer
.
MessageLoop
,
request_deserializer
=
model__pb2
.
ClientMsg
.
FromString
,
request_deserializer
=
model__pb2
.
ClientMsg
.
FromString
,
response_serializer
=
model__pb2
.
ServerMsg
.
SerializeToString
,
response_serializer
=
model__pb2
.
ServerMsg
.
SerializeToString
,
),
),
}
}
generic_handler
=
grpc
.
method_handlers_generic_handler
(
generic_handler
=
grpc
.
method_handlers_generic_handler
(
'
pbx.Node
'
,
rpc_method_handlers
)
'
pbx.Node
'
,
rpc_method_handlers
)
server
.
add_generic_rpc_handlers
((
generic_handler
,))
server
.
add_generic_rpc_handlers
((
generic_handler
,))
class
PluginStub
(
object
):
# This class is part of an EXPERIMENTAL API.
"""
Plugin interface.
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
)
def
__init__
(
self
,
channel
):
"""
Constructor.
Args
:
class
PluginStub
(
object
)
:
channel: A grpc.Channel
.
"""
Plugin interface
.
"""
"""
self
.
FireHose
=
channel
.
unary_unary
(
'
/pbx.Plugin/FireHose
'
,
def
__init__
(
self
,
channel
):
request_serializer
=
model__pb2
.
ClientReq
.
SerializeToString
,
"""
Constructor.
response_deserializer
=
model__pb2
.
ServerResp
.
FromString
,
)
Args:
self
.
Find
=
channel
.
unary_unary
(
channel: A grpc.Channel.
'
/pbx.Plugin/Find
'
,
"""
request_serializer
=
model__pb2
.
SearchQuery
.
SerializeToString
,
self
.
FireHose
=
channel
.
unary_unary
(
response_deserializer
=
model__pb2
.
SearchFound
.
FromString
,
'
/pbx.Plugin/FireHose
'
,
)
request_serializer
=
model__pb2
.
ClientReq
.
SerializeToString
,
self
.
Account
=
channel
.
unary_unary
(
response_deserializer
=
model__pb2
.
ServerResp
.
FromString
,
'
/pbx.Plugin/Account
'
,
)
request_serializer
=
model__pb2
.
AccountEvent
.
SerializeToString
,
self
.
Find
=
channel
.
unary_unary
(
response_deserializer
=
model__pb2
.
Unused
.
FromString
,
'
/pbx.Plugin/Find
'
,
)
request_serializer
=
model__pb2
.
SearchQuery
.
SerializeToString
,
self
.
Topic
=
channel
.
unary_unary
(
response_deserializer
=
model__pb2
.
SearchFound
.
FromString
,
'
/pbx.Plugin/Topic
'
,
)
request_serializer
=
model__pb2
.
TopicEvent
.
SerializeToString
,
self
.
Account
=
channel
.
unary_unary
(
response_deserializer
=
model__pb2
.
Unused
.
FromString
,
'
/pbx.Plugin/Account
'
,
)
request_serializer
=
model__pb2
.
AccountEvent
.
SerializeToString
,
self
.
Subscription
=
channel
.
unary_unary
(
response_deserializer
=
model__pb2
.
Unused
.
FromString
,
'
/pbx.Plugin/Subscription
'
,
)
request_serializer
=
model__pb2
.
SubscriptionEvent
.
SerializeToString
,
self
.
Topic
=
channel
.
unary_unary
(
response_deserializer
=
model__pb2
.
Unused
.
FromString
,
'
/pbx.Plugin/Topic
'
,
)
request_serializer
=
model__pb2
.
TopicEvent
.
SerializeToString
,
self
.
Message
=
channel
.
unary_unary
(
response_deserializer
=
model__pb2
.
Unused
.
FromString
,
'
/pbx.Plugin/Message
'
,
)
request_serializer
=
model__pb2
.
MessageEvent
.
SerializeToString
,
self
.
Subscription
=
channel
.
unary_unary
(
response_deserializer
=
model__pb2
.
Unused
.
FromString
,
'
/pbx.Plugin/Subscription
'
,
)
request_serializer
=
model__pb2
.
SubscriptionEvent
.
SerializeToString
,
response_deserializer
=
model__pb2
.
Unused
.
FromString
,
)
self
.
Message
=
channel
.
unary_unary
(
'
/pbx.Plugin/Message
'
,
request_serializer
=
model__pb2
.
MessageEvent
.
SerializeToString
,
response_deserializer
=
model__pb2
.
Unused
.
FromString
,
)
class
PluginServicer
(
object
):
class
PluginServicer
(
object
):
"""
Plugin interface.
"""
Plugin interface.
"""
def
FireHose
(
self
,
request
,
context
):
"""
This plugin method is called by Tinode server for every message received from the clients. The
method returns a ServerCtrl message. Non-zero ServerCtrl.code indicates that no further
processing is needed. The Tinode server will generate a {ctrl} message from the returned ServerCtrl
and forward it to the client session.
ServerCtrl.code equals to 0 instructs the server to continue with default processing of the client message.
"""
"""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'
Method not implemented!
'
)
raise
NotImplementedError
(
'
Method not implemented!
'
)
def
Find
(
self
,
request
,
context
):
def
FireHose
(
self
,
request
,
context
):
"""
An alteranative user and topic discovery mechanism.
"""
This plugin method is called by Tinode server for every message received from the clients. The
A search request issued on a
'
fnd
'
topic. This method is called to generate an alternative result set.
method returns a ServerCtrl message. Non-zero ServerCtrl.code indicates that no further
"""
processing is needed. The Tinode server will generate a {ctrl} message from the returned ServerCtrl
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
and forward it to the client session.
context
.
set_details
(
'
Method not implemented!
'
)
ServerCtrl.code equals to 0 instructs the server to continue with default processing of the client message.
raise
NotImplementedError
(
'
Method not implemented!
'
)
"""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'
Method not implemented!
'
)
raise
NotImplementedError
(
'
Method not implemented!
'
)
def
Account
(
self
,
request
,
context
):
def
Find
(
self
,
request
,
context
):
"""
The following methods are for the Tinode server to report individual events.
"""
An alteranative user and topic discovery mechanism.
A search request issued on a
'
fnd
'
topic. This method is called to generate an alternative result set.
"""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'
Method not implemented!
'
)
raise
NotImplementedError
(
'
Method not implemented!
'
)
Account created, updated or deleted
def
Account
(
self
,
request
,
context
):
"""
"""
The following methods are for the Tinode server to report individual events.
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'
Method not implemented!
'
)
raise
NotImplementedError
(
'
Method not implemented!
'
)
def
Topic
(
self
,
request
,
context
):
Account created, updated or deleted
"""
Topic created, updated [or deleted -- not supported yet]
"""
"""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'
Method not implemented!
'
)
context
.
set_details
(
'
Method not implemented!
'
)
raise
NotImplementedError
(
'
Method not implemented!
'
)
raise
NotImplementedError
(
'
Method not implemented!
'
)
def
Subscription
(
self
,
request
,
context
):
def
Topic
(
self
,
request
,
context
):
"""
Subscription
created, updated or deleted
"""
Topic
created, updated
[
or deleted
-- not supported yet]
"""
"""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'
Method not implemented!
'
)
context
.
set_details
(
'
Method not implemented!
'
)
raise
NotImplementedError
(
'
Method not implemented!
'
)
raise
NotImplementedError
(
'
Method not implemented!
'
)
def
Message
(
self
,
request
,
context
):
def
Subscription
(
self
,
request
,
context
):
"""
Message published or deleted
"""
Subscription created, updated or deleted
"""
"""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'
Method not implemented!
'
)
context
.
set_details
(
'
Method not implemented!
'
)
raise
NotImplementedError
(
'
Method not implemented!
'
)
raise
NotImplementedError
(
'
Method not implemented!
'
)
def
Message
(
self
,
request
,
context
):
"""
Message published or deleted
"""
context
.
set_code
(
grpc
.
StatusCode
.
UNIMPLEMENTED
)
context
.
set_details
(
'
Method not implemented!
'
)
raise
NotImplementedError
(
'
Method not implemented!
'
)
def
add_PluginServicer_to_server
(
servicer
,
server
):
def
add_PluginServicer_to_server
(
servicer
,
server
):
rpc_method_handlers
=
{
rpc_method_handlers
=
{
'
FireHose
'
:
grpc
.
unary_unary_rpc_method_handler
(
'
FireHose
'
:
grpc
.
unary_unary_rpc_method_handler
(
servicer
.
FireHose
,
servicer
.
FireHose
,
request_deserializer
=
model__pb2
.
ClientReq
.
FromString
,
request_deserializer
=
model__pb2
.
ClientReq
.
FromString
,
response_serializer
=
model__pb2
.
ServerResp
.
SerializeToString
,
response_serializer
=
model__pb2
.
ServerResp
.
SerializeToString
,
),
),
'
Find
'
:
grpc
.
unary_unary_rpc_method_handler
(
'
Find
'
:
grpc
.
unary_unary_rpc_method_handler
(
servicer
.
Find
,
servicer
.
Find
,
request_deserializer
=
model__pb2
.
SearchQuery
.
FromString
,
request_deserializer
=
model__pb2
.
SearchQuery
.
FromString
,
response_serializer
=
model__pb2
.
SearchFound
.
SerializeToString
,
response_serializer
=
model__pb2
.
SearchFound
.
SerializeToString
,
),
),
'
Account
'
:
grpc
.
unary_unary_rpc_method_handler
(
'
Account
'
:
grpc
.
unary_unary_rpc_method_handler
(
servicer
.
Account
,
servicer
.
Account
,
request_deserializer
=
model__pb2
.
AccountEvent
.
FromString
,
request_deserializer
=
model__pb2
.
AccountEvent
.
FromString
,
response_serializer
=
model__pb2
.
Unused
.
SerializeToString
,
response_serializer
=
model__pb2
.
Unused
.
SerializeToString
,
),
),
'
Topic
'
:
grpc
.
unary_unary_rpc_method_handler
(
'
Topic
'
:
grpc
.
unary_unary_rpc_method_handler
(
servicer
.
Topic
,
servicer
.
Topic
,
request_deserializer
=
model__pb2
.
TopicEvent
.
FromString
,
request_deserializer
=
model__pb2
.
TopicEvent
.
FromString
,
response_serializer
=
model__pb2
.
Unused
.
SerializeToString
,
response_serializer
=
model__pb2
.
Unused
.
SerializeToString
,
),
),
'
Subscription
'
:
grpc
.
unary_unary_rpc_method_handler
(
'
Subscription
'
:
grpc
.
unary_unary_rpc_method_handler
(
servicer
.
Subscription
,
servicer
.
Subscription
,
request_deserializer
=
model__pb2
.
SubscriptionEvent
.
FromString
,
request_deserializer
=
model__pb2
.
SubscriptionEvent
.
FromString
,
response_serializer
=
model__pb2
.
Unused
.
SerializeToString
,
response_serializer
=
model__pb2
.
Unused
.
SerializeToString
,
),
),
'
Message
'
:
grpc
.
unary_unary_rpc_method_handler
(
'
Message
'
:
grpc
.
unary_unary_rpc_method_handler
(
servicer
.
Message
,
servicer
.
Message
,
request_deserializer
=
model__pb2
.
MessageEvent
.
FromString
,
request_deserializer
=
model__pb2
.
MessageEvent
.
FromString
,
response_serializer
=
model__pb2
.
Unused
.
SerializeToString
,
response_serializer
=
model__pb2
.
Unused
.
SerializeToString
,
),
),
}
}
generic_handler
=
grpc
.
method_handlers_generic_handler
(
generic_handler
=
grpc
.
method_handlers_generic_handler
(
'
pbx.Plugin
'
,
rpc_method_handlers
)
'
pbx.Plugin
'
,
rpc_method_handlers
)
server
.
add_generic_rpc_handlers
((
generic_handler
,))
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment