This commit is contained in:
parent
5f1f88106c
commit
87b92548a4
@ -1,3 +0,0 @@
|
||||
import google.protobuf.descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2
|
||||
from . import hrpc_pb2 as hrpc__pb2
|
||||
import purerpc
|
@ -1,113 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# source: hrpc.proto
|
||||
|
||||
from google.protobuf import descriptor as _descriptor
|
||||
from google.protobuf import message as _message
|
||||
from google.protobuf import reflection as _reflection
|
||||
from google.protobuf import symbol_database as _symbol_database
|
||||
|
||||
# @@protoc_insertion_point(imports)
|
||||
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
from google.protobuf import (
|
||||
descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2,
|
||||
)
|
||||
|
||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
||||
name="hrpc.proto",
|
||||
package="hrpc",
|
||||
syntax="proto2",
|
||||
serialized_options=None,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
serialized_pb=b'\n\nhrpc.proto\x12\x04hrpc\x1a google/protobuf/descriptor.proto"\x06\n\x04Void:2\n\x07service\x12\x1f.google.protobuf.ServiceOptions\x18\xd0\x86\x03 \x01(\r:0\n\x06method\x12\x1e.google.protobuf.MethodOptions\x18\xd1\x86\x03 \x01(\r',
|
||||
dependencies=[google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR,],
|
||||
)
|
||||
|
||||
|
||||
SERVICE_FIELD_NUMBER = 50000
|
||||
service = _descriptor.FieldDescriptor(
|
||||
name="service",
|
||||
full_name="hrpc.service",
|
||||
index=0,
|
||||
number=50000,
|
||||
type=13,
|
||||
cpp_type=3,
|
||||
label=1,
|
||||
has_default_value=False,
|
||||
default_value=0,
|
||||
message_type=None,
|
||||
enum_type=None,
|
||||
containing_type=None,
|
||||
is_extension=True,
|
||||
extension_scope=None,
|
||||
serialized_options=None,
|
||||
file=DESCRIPTOR,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
)
|
||||
METHOD_FIELD_NUMBER = 50001
|
||||
method = _descriptor.FieldDescriptor(
|
||||
name="method",
|
||||
full_name="hrpc.method",
|
||||
index=1,
|
||||
number=50001,
|
||||
type=13,
|
||||
cpp_type=3,
|
||||
label=1,
|
||||
has_default_value=False,
|
||||
default_value=0,
|
||||
message_type=None,
|
||||
enum_type=None,
|
||||
containing_type=None,
|
||||
is_extension=True,
|
||||
extension_scope=None,
|
||||
serialized_options=None,
|
||||
file=DESCRIPTOR,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
)
|
||||
|
||||
|
||||
_VOID = _descriptor.Descriptor(
|
||||
name="Void",
|
||||
full_name="hrpc.Void",
|
||||
filename=None,
|
||||
file=DESCRIPTOR,
|
||||
containing_type=None,
|
||||
create_key=_descriptor._internal_create_key,
|
||||
fields=[],
|
||||
extensions=[],
|
||||
nested_types=[],
|
||||
enum_types=[],
|
||||
serialized_options=None,
|
||||
is_extendable=False,
|
||||
syntax="proto2",
|
||||
extension_ranges=[],
|
||||
oneofs=[],
|
||||
serialized_start=54,
|
||||
serialized_end=60,
|
||||
)
|
||||
|
||||
DESCRIPTOR.message_types_by_name["Void"] = _VOID
|
||||
DESCRIPTOR.extensions_by_name["service"] = service
|
||||
DESCRIPTOR.extensions_by_name["method"] = method
|
||||
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
|
||||
|
||||
Void = _reflection.GeneratedProtocolMessageType(
|
||||
"Void",
|
||||
(_message.Message,),
|
||||
{
|
||||
"DESCRIPTOR": _VOID,
|
||||
"__module__": "hrpc_pb2"
|
||||
# @@protoc_insertion_point(class_scope:hrpc.Void)
|
||||
},
|
||||
)
|
||||
_sym_db.RegisterMessage(Void)
|
||||
|
||||
google_dot_protobuf_dot_descriptor__pb2.ServiceOptions.RegisterExtension(
|
||||
service
|
||||
)
|
||||
google_dot_protobuf_dot_descriptor__pb2.MethodOptions.RegisterExtension(method)
|
||||
|
||||
# @@protoc_insertion_point(module_scope)
|
@ -1,732 +0,0 @@
|
||||
from . import hrpc_pb2 as hrpc__pb2
|
||||
import purerpc
|
||||
|
||||
from . import schema_pb2 as schema__pb2
|
||||
|
||||
|
||||
class HyperspaceServicer(purerpc.Servicer):
|
||||
async def Status(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
@property
|
||||
def service(self) -> purerpc.Service:
|
||||
service_obj = purerpc.Service("hyperspace.Hyperspace")
|
||||
service_obj.add_method(
|
||||
"Status",
|
||||
self.Status,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
hrpc__pb2.Void,
|
||||
schema__pb2.HyperspaceStatusResponse,
|
||||
),
|
||||
)
|
||||
return service_obj
|
||||
|
||||
|
||||
class HyperspaceStub:
|
||||
def __init__(self, channel):
|
||||
self._client = purerpc.Client("hyperspace.Hyperspace", channel)
|
||||
self.Status = self._client.get_method_stub(
|
||||
"Status",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
hrpc__pb2.Void,
|
||||
schema__pb2.HyperspaceStatusResponse,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class CorestoreServicer(purerpc.Servicer):
|
||||
async def Open(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def OnFeed(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
@property
|
||||
def service(self) -> purerpc.Service:
|
||||
service_obj = purerpc.Service("hyperspace.Corestore")
|
||||
service_obj.add_method(
|
||||
"Open",
|
||||
self.Open,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.OpenRequest,
|
||||
schema__pb2.OpenResponse,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"OnFeed",
|
||||
self.OnFeed,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.FeedEvent,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
return service_obj
|
||||
|
||||
|
||||
class CorestoreStub:
|
||||
def __init__(self, channel):
|
||||
self._client = purerpc.Client("hyperspace.Corestore", channel)
|
||||
self.Open = self._client.get_method_stub(
|
||||
"Open",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.OpenRequest,
|
||||
schema__pb2.OpenResponse,
|
||||
),
|
||||
)
|
||||
self.OnFeed = self._client.get_method_stub(
|
||||
"OnFeed",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.FeedEvent,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class HypercoreServicer(purerpc.Servicer):
|
||||
async def Get(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def Append(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def Update(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def Seek(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def Has(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def Cancel(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def Download(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def Downloaded(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def Undownload(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def Close(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def RegisterExtension(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def UnregisterExtension(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def SendExtension(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def AcquireLock(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def ReleaseLock(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def OnAppend(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def OnClose(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def OnPeerOpen(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def OnPeerRemove(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def OnExtension(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def OnWait(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
@property
|
||||
def service(self) -> purerpc.Service:
|
||||
service_obj = purerpc.Service("hyperspace.Hypercore")
|
||||
service_obj.add_method(
|
||||
"Get",
|
||||
self.Get,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.GetRequest,
|
||||
schema__pb2.GetResponse,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"Append",
|
||||
self.Append,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.AppendRequest,
|
||||
schema__pb2.AppendResponse,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"Update",
|
||||
self.Update,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.UpdateRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"Seek",
|
||||
self.Seek,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.SeekRequest,
|
||||
schema__pb2.SeekResponse,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"Has",
|
||||
self.Has,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.HasRequest,
|
||||
schema__pb2.HasResponse,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"Cancel",
|
||||
self.Cancel,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.CancelRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"Download",
|
||||
self.Download,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.DownloadRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"Downloaded",
|
||||
self.Downloaded,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.DownloadedRequest,
|
||||
schema__pb2.DownloadedResponse,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"Undownload",
|
||||
self.Undownload,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.UndownloadRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"Close",
|
||||
self.Close,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.CloseRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"RegisterExtension",
|
||||
self.RegisterExtension,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.RegisterExtensionRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"UnregisterExtension",
|
||||
self.UnregisterExtension,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.UnregisterExtensionRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"SendExtension",
|
||||
self.SendExtension,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.ExtensionMessage,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"AcquireLock",
|
||||
self.AcquireLock,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.LockRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"ReleaseLock",
|
||||
self.ReleaseLock,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.LockRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"OnAppend",
|
||||
self.OnAppend,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.AppendEvent,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"OnClose",
|
||||
self.OnClose,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.CloseEvent,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"OnPeerOpen",
|
||||
self.OnPeerOpen,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.PeerEvent,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"OnPeerRemove",
|
||||
self.OnPeerRemove,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.PeerEvent,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"OnExtension",
|
||||
self.OnExtension,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.ExtensionMessage,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"OnWait",
|
||||
self.OnWait,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.WaitEvent,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
return service_obj
|
||||
|
||||
|
||||
class HypercoreStub:
|
||||
def __init__(self, channel):
|
||||
self._client = purerpc.Client("hyperspace.Hypercore", channel)
|
||||
self.Get = self._client.get_method_stub(
|
||||
"Get",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.GetRequest,
|
||||
schema__pb2.GetResponse,
|
||||
),
|
||||
)
|
||||
self.Append = self._client.get_method_stub(
|
||||
"Append",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.AppendRequest,
|
||||
schema__pb2.AppendResponse,
|
||||
),
|
||||
)
|
||||
self.Update = self._client.get_method_stub(
|
||||
"Update",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.UpdateRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.Seek = self._client.get_method_stub(
|
||||
"Seek",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.SeekRequest,
|
||||
schema__pb2.SeekResponse,
|
||||
),
|
||||
)
|
||||
self.Has = self._client.get_method_stub(
|
||||
"Has",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.HasRequest,
|
||||
schema__pb2.HasResponse,
|
||||
),
|
||||
)
|
||||
self.Cancel = self._client.get_method_stub(
|
||||
"Cancel",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.CancelRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.Download = self._client.get_method_stub(
|
||||
"Download",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.DownloadRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.Downloaded = self._client.get_method_stub(
|
||||
"Downloaded",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.DownloadedRequest,
|
||||
schema__pb2.DownloadedResponse,
|
||||
),
|
||||
)
|
||||
self.Undownload = self._client.get_method_stub(
|
||||
"Undownload",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.UndownloadRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.Close = self._client.get_method_stub(
|
||||
"Close",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.CloseRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.RegisterExtension = self._client.get_method_stub(
|
||||
"RegisterExtension",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.RegisterExtensionRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.UnregisterExtension = self._client.get_method_stub(
|
||||
"UnregisterExtension",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.UnregisterExtensionRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.SendExtension = self._client.get_method_stub(
|
||||
"SendExtension",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.ExtensionMessage,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.AcquireLock = self._client.get_method_stub(
|
||||
"AcquireLock",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.LockRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.ReleaseLock = self._client.get_method_stub(
|
||||
"ReleaseLock",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.LockRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.OnAppend = self._client.get_method_stub(
|
||||
"OnAppend",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.AppendEvent,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.OnClose = self._client.get_method_stub(
|
||||
"OnClose",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.CloseEvent,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.OnPeerOpen = self._client.get_method_stub(
|
||||
"OnPeerOpen",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.PeerEvent,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.OnPeerRemove = self._client.get_method_stub(
|
||||
"OnPeerRemove",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.PeerEvent,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.OnExtension = self._client.get_method_stub(
|
||||
"OnExtension",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.ExtensionMessage,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.OnWait = self._client.get_method_stub(
|
||||
"OnWait",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.WaitEvent,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class NetworkServicer(purerpc.Servicer):
|
||||
async def Open(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def Configure(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def Status(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def AllStatuses(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def RegisterExtension(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def UnregisterExtension(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def SendExtension(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def OnPeerAdd(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def OnPeerRemove(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
async def OnExtension(self, input_message):
|
||||
raise NotImplementedError()
|
||||
|
||||
@property
|
||||
def service(self) -> purerpc.Service:
|
||||
service_obj = purerpc.Service("hyperspace.Network")
|
||||
service_obj.add_method(
|
||||
"Open",
|
||||
self.Open,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
hrpc__pb2.Void,
|
||||
schema__pb2.OpenNetworkResponse,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"Configure",
|
||||
self.Configure,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.ConfigureNetworkRequest,
|
||||
schema__pb2.NetworkStatusResponse,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"Status",
|
||||
self.Status,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.NetworkStatusRequest,
|
||||
schema__pb2.NetworkStatusResponse,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"AllStatuses",
|
||||
self.AllStatuses,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
hrpc__pb2.Void,
|
||||
schema__pb2.AllNetworkStatusesResponse,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"RegisterExtension",
|
||||
self.RegisterExtension,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.RegisterExtensionRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"UnregisterExtension",
|
||||
self.UnregisterExtension,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.UnregisterExtensionRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"SendExtension",
|
||||
self.SendExtension,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.ExtensionMessage,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"OnPeerAdd",
|
||||
self.OnPeerAdd,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.PeerEvent,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"OnPeerRemove",
|
||||
self.OnPeerRemove,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.PeerEvent,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
service_obj.add_method(
|
||||
"OnExtension",
|
||||
self.OnExtension,
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.ExtensionMessage,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
return service_obj
|
||||
|
||||
|
||||
class NetworkStub:
|
||||
def __init__(self, channel):
|
||||
self._client = purerpc.Client("hyperspace.Network", channel)
|
||||
self.Open = self._client.get_method_stub(
|
||||
"Open",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
hrpc__pb2.Void,
|
||||
schema__pb2.OpenNetworkResponse,
|
||||
),
|
||||
)
|
||||
self.Configure = self._client.get_method_stub(
|
||||
"Configure",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.ConfigureNetworkRequest,
|
||||
schema__pb2.NetworkStatusResponse,
|
||||
),
|
||||
)
|
||||
self.Status = self._client.get_method_stub(
|
||||
"Status",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.NetworkStatusRequest,
|
||||
schema__pb2.NetworkStatusResponse,
|
||||
),
|
||||
)
|
||||
self.AllStatuses = self._client.get_method_stub(
|
||||
"AllStatuses",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
hrpc__pb2.Void,
|
||||
schema__pb2.AllNetworkStatusesResponse,
|
||||
),
|
||||
)
|
||||
self.RegisterExtension = self._client.get_method_stub(
|
||||
"RegisterExtension",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.RegisterExtensionRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.UnregisterExtension = self._client.get_method_stub(
|
||||
"UnregisterExtension",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.UnregisterExtensionRequest,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.SendExtension = self._client.get_method_stub(
|
||||
"SendExtension",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.ExtensionMessage,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.OnPeerAdd = self._client.get_method_stub(
|
||||
"OnPeerAdd",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.PeerEvent,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.OnPeerRemove = self._client.get_method_stub(
|
||||
"OnPeerRemove",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.PeerEvent,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
||||
self.OnExtension = self._client.get_method_stub(
|
||||
"OnExtension",
|
||||
purerpc.RPCSignature(
|
||||
purerpc.Cardinality.UNARY_UNARY,
|
||||
schema__pb2.ExtensionMessage,
|
||||
hrpc__pb2.Void,
|
||||
),
|
||||
)
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user