Commit 6c4a05e7 authored by ozzeh's avatar ozzeh
Browse files

Initial commit

parents
.DS_Store
.vscode/
.idea/
\ No newline at end of file
#!/bin/bash
python -m grpc_tools.protoc -I proto --python_out=./ --grpc_python_out=./ --python_grpc_out=./ proto/grpc_madmin/.proto*
# Generated by the Protocol Buffers compiler. DO NOT EDIT!
# source: grpc_madmin/generic.proto
# plugin: grpclib.plugin.main
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: grpc_madmin/generic.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
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()
DESCRIPTOR = _descriptor.FileDescriptor(
name='grpc_madmin/generic.proto',
package='grpc_madmin.generic',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\x19grpc_madmin/generic.proto\x12\x13grpc_madmin.generic\"2\n\x0fGenericResponse\x12\x0e\n\x06result\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\tb\x06proto3')
)
_GENERICRESPONSE = _descriptor.Descriptor(
name='GenericResponse',
full_name='grpc_madmin.generic.GenericResponse',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='result', full_name='grpc_madmin.generic.GenericResponse.result', index=0,
number=1, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='message', full_name='grpc_madmin.generic.GenericResponse.message', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=50,
serialized_end=100,
)
DESCRIPTOR.message_types_by_name['GenericResponse'] = _GENERICRESPONSE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
GenericResponse = _reflection.GeneratedProtocolMessageType('GenericResponse', (_message.Message,), {
'DESCRIPTOR' : _GENERICRESPONSE,
'__module__' : 'grpc_madmin.generic_pb2'
# @@protoc_insertion_point(class_scope:grpc_madmin.generic.GenericResponse)
})
_sym_db.RegisterMessage(GenericResponse)
# @@protoc_insertion_point(module_scope)
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
# Generated by the Protocol Buffers compiler. DO NOT EDIT!
# source: grpc_madmin/invite.proto
# plugin: grpclib.plugin.main
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: grpc_madmin/invite.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
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()
DESCRIPTOR = _descriptor.FileDescriptor(
name='grpc_madmin/invite.proto',
package='grpc_madmin.invite',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\x18grpc_madmin/invite.proto\x12\x12grpc_madmin.invite\"=\n\x11UserInviteRequest\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x01 \x01(\t\x12\x12\n\ndiscord_id\x18\x02 \x01(\x03\x62\x06proto3')
)
_USERINVITEREQUEST = _descriptor.Descriptor(
name='UserInviteRequest',
full_name='grpc_madmin.invite.UserInviteRequest',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='access_token', full_name='grpc_madmin.invite.UserInviteRequest.access_token', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='discord_id', full_name='grpc_madmin.invite.UserInviteRequest.discord_id', index=1,
number=2, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=48,
serialized_end=109,
)
DESCRIPTOR.message_types_by_name['UserInviteRequest'] = _USERINVITEREQUEST
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
UserInviteRequest = _reflection.GeneratedProtocolMessageType('UserInviteRequest', (_message.Message,), {
'DESCRIPTOR' : _USERINVITEREQUEST,
'__module__' : 'grpc_madmin.invite_pb2'
# @@protoc_insertion_point(class_scope:grpc_madmin.invite.UserInviteRequest)
})
_sym_db.RegisterMessage(UserInviteRequest)
# @@protoc_insertion_point(module_scope)
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
# Generated by the Protocol Buffers compiler. DO NOT EDIT!
# source: grpc_madmin/user.proto
# plugin: grpclib.plugin.main
import abc
import typing
import grpclib.const
import grpclib.client
if typing.TYPE_CHECKING:
import grpclib.server
import grpc_madmin.generic_pb2
import grpc_madmin.user_pb2
class UserServiceBase(abc.ABC):
@abc.abstractmethod
async def OnUpdateUser(self, stream: 'grpclib.server.Stream[grpc_madmin.user_pb2.UserAccessUpdated, grpc_madmin.generic_pb2.GenericResponse]') -> None:
pass
def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
return {
'/grpc_madmin.user.UserService/OnUpdateUser': grpclib.const.Handler(
self.OnUpdateUser,
grpclib.const.Cardinality.UNARY_UNARY,
grpc_madmin.user_pb2.UserAccessUpdated,
grpc_madmin.generic_pb2.GenericResponse,
),
}
class UserServiceStub:
def __init__(self, channel: grpclib.client.Channel) -> None:
self.OnUpdateUser = grpclib.client.UnaryUnaryMethod(
channel,
'/grpc_madmin.user.UserService/OnUpdateUser',
grpc_madmin.user_pb2.UserAccessUpdated,
grpc_madmin.generic_pb2.GenericResponse,
)
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: grpc_madmin/user.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
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 grpc_madmin import generic_pb2 as grpc__madmin_dot_generic__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name='grpc_madmin/user.proto',
package='grpc_madmin.user',
syntax='proto3',
serialized_options=None,
serialized_pb=_b('\n\x16grpc_madmin/user.proto\x12\x10grpc_madmin.user\x1a\x19grpc_madmin/generic.proto\"\\\n\x11UserAccessUpdated\x12\x0f\n\x07\x61uth_id\x18\x01 \x01(\x05\x12\x10\n\x08sso_uuid\x18\x02 \x01(\t\x12\x10\n\x08username\x18\x03 \x01(\t\x12\x12\n\ndiscord_id\x18\x04 \x01(\x03\x32h\n\x0bUserService\x12Y\n\x0cOnUpdateUser\x12#.grpc_madmin.user.UserAccessUpdated\x1a$.grpc_madmin.generic.GenericResponseb\x06proto3')
,
dependencies=[grpc__madmin_dot_generic__pb2.DESCRIPTOR,])
_USERACCESSUPDATED = _descriptor.Descriptor(
name='UserAccessUpdated',
full_name='grpc_madmin.user.UserAccessUpdated',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='auth_id', full_name='grpc_madmin.user.UserAccessUpdated.auth_id', index=0,
number=1, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='sso_uuid', full_name='grpc_madmin.user.UserAccessUpdated.sso_uuid', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='username', full_name='grpc_madmin.user.UserAccessUpdated.username', index=2,
number=3, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='discord_id', full_name='grpc_madmin.user.UserAccessUpdated.discord_id', index=3,
number=4, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=71,
serialized_end=163,
)
DESCRIPTOR.message_types_by_name['UserAccessUpdated'] = _USERACCESSUPDATED
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
UserAccessUpdated = _reflection.GeneratedProtocolMessageType('UserAccessUpdated', (_message.Message,), {
'DESCRIPTOR' : _USERACCESSUPDATED,
'__module__' : 'grpc_madmin.user_pb2'
# @@protoc_insertion_point(class_scope:grpc_madmin.user.UserAccessUpdated)
})
_sym_db.RegisterMessage(UserAccessUpdated)
_USERSERVICE = _descriptor.ServiceDescriptor(
name='UserService',
full_name='grpc_madmin.user.UserService',
file=DESCRIPTOR,
index=0,
serialized_options=None,
serialized_start=165,
serialized_end=269,
methods=[
_descriptor.MethodDescriptor(
name='OnUpdateUser',
full_name='grpc_madmin.user.UserService.OnUpdateUser',
index=0,
containing_service=None,
input_type=_USERACCESSUPDATED,
output_type=grpc__madmin_dot_generic__pb2._GENERICRESPONSE,
serialized_options=None,
),
])
_sym_db.RegisterServiceDescriptor(_USERSERVICE)
DESCRIPTOR.services_by_name['UserService'] = _USERSERVICE
# @@protoc_insertion_point(module_scope)
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from grpc_madmin import generic_pb2 as grpc__madmin_dot_generic__pb2
from grpc_madmin import user_pb2 as grpc__madmin_dot_user__pb2
class UserServiceStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.OnUpdateUser = channel.unary_unary(
'/grpc_madmin.user.UserService/OnUpdateUser',
request_serializer=grpc__madmin_dot_user__pb2.UserAccessUpdated.SerializeToString,
response_deserializer=grpc__madmin_dot_generic__pb2.GenericResponse.FromString,
)
class UserServiceServicer(object):
# missing associated documentation comment in .proto file
pass
def OnUpdateUser(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_UserServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'OnUpdateUser': grpc.unary_unary_rpc_method_handler(
servicer.OnUpdateUser,
request_deserializer=grpc__madmin_dot_user__pb2.UserAccessUpdated.FromString,
response_serializer=grpc__madmin_dot_generic__pb2.GenericResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'grpc_madmin.user.UserService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
syntax = "proto3";
package grpc_madmin.generic;
message GenericResponse {
bool result = 1;
string message = 2;
}
\ No newline at end of file
syntax = "proto3";
package grpc_madmin.invite;
message UserInviteRequest {
string access_token = 1;
int64 discord_id = 2;
}
\ No newline at end of file
syntax = "proto3";
package grpc_madmin.user;
import "grpc_madmin/generic.proto";
message UserAccessUpdated {
int32 auth_id = 1;
string sso_uuid = 2;
string username = 3;
int64 discord_id = 4;
}
service UserService {
rpc OnUpdateUser (UserAccessUpdated) returns (grpc_madmin.generic.GenericResponse);
}
\ No newline at end of file
from setuptools import setup
setup(
name="grpc_madmin",
version="0.1",
packages=["grpc_madmin"],
install_requires=["grpcio", "googleapis-common-protos"],
zip_safe=False,
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment