Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 | # source: schema.proto |
| 3 | |
| 4 | import sys |
| 5 | _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) |
| 6 | from google.protobuf import descriptor as _descriptor |
| 7 | from google.protobuf import message as _message |
| 8 | from google.protobuf import reflection as _reflection |
| 9 | from google.protobuf import symbol_database as _symbol_database |
| 10 | from google.protobuf import descriptor_pb2 |
| 11 | # @@protoc_insertion_point(imports) |
| 12 | |
| 13 | _sym_db = _symbol_database.Default() |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | DESCRIPTOR = _descriptor.FileDescriptor( |
| 19 | name='schema.proto', |
| 20 | package='schema', |
| 21 | syntax='proto3', |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 22 | serialized_pb=_b('\n\x0cschema.proto\x12\x06schema\"A\n\tProtoFile\x12\x11\n\tfile_name\x18\x01 \x01(\t\x12\r\n\x05proto\x18\x02 \x01(\t\x12\x12\n\ndescriptor\x18\x03 \x01(\x0c\",\n\x07Schemas\x12!\n\x06protos\x18\x01 \x03(\x0b\x32\x11.schema.ProtoFile\"\r\n\x0bNullMessage2D\n\rSchemaService\x12\x33\n\tGetSchema\x12\x13.schema.NullMessage\x1a\x0f.schema.Schemas\"\x00\x62\x06proto3') |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 23 | ) |
| 24 | _sym_db.RegisterFileDescriptor(DESCRIPTOR) |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 29 | _PROTOFILE = _descriptor.Descriptor( |
| 30 | name='ProtoFile', |
| 31 | full_name='schema.ProtoFile', |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 32 | filename=None, |
| 33 | file=DESCRIPTOR, |
| 34 | containing_type=None, |
| 35 | fields=[ |
| 36 | _descriptor.FieldDescriptor( |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 37 | name='file_name', full_name='schema.ProtoFile.file_name', index=0, |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 38 | number=1, type=9, cpp_type=9, label=1, |
| 39 | has_default_value=False, default_value=_b("").decode('utf-8'), |
| 40 | message_type=None, enum_type=None, containing_type=None, |
| 41 | is_extension=False, extension_scope=None, |
| 42 | options=None), |
| 43 | _descriptor.FieldDescriptor( |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 44 | name='proto', full_name='schema.ProtoFile.proto', index=1, |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 45 | number=2, type=9, cpp_type=9, label=1, |
| 46 | has_default_value=False, default_value=_b("").decode('utf-8'), |
| 47 | message_type=None, enum_type=None, containing_type=None, |
| 48 | is_extension=False, extension_scope=None, |
| 49 | options=None), |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 50 | _descriptor.FieldDescriptor( |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 51 | name='descriptor', full_name='schema.ProtoFile.descriptor', index=2, |
| 52 | number=3, type=12, cpp_type=9, label=1, |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 53 | has_default_value=False, default_value=_b(""), |
| 54 | message_type=None, enum_type=None, containing_type=None, |
| 55 | is_extension=False, extension_scope=None, |
| 56 | options=None), |
| 57 | ], |
| 58 | extensions=[ |
| 59 | ], |
| 60 | nested_types=[], |
| 61 | enum_types=[ |
| 62 | ], |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 63 | options=None, |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 64 | is_extendable=False, |
| 65 | syntax='proto3', |
| 66 | extension_ranges=[], |
| 67 | oneofs=[ |
| 68 | ], |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 69 | serialized_start=24, |
| 70 | serialized_end=89, |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 71 | ) |
| 72 | |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 73 | |
| 74 | _SCHEMAS = _descriptor.Descriptor( |
| 75 | name='Schemas', |
| 76 | full_name='schema.Schemas', |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 77 | filename=None, |
| 78 | file=DESCRIPTOR, |
| 79 | containing_type=None, |
| 80 | fields=[ |
| 81 | _descriptor.FieldDescriptor( |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 82 | name='protos', full_name='schema.Schemas.protos', index=0, |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 83 | number=1, type=11, cpp_type=10, label=3, |
| 84 | has_default_value=False, default_value=[], |
| 85 | message_type=None, enum_type=None, containing_type=None, |
| 86 | is_extension=False, extension_scope=None, |
| 87 | options=None), |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 88 | ], |
| 89 | extensions=[ |
| 90 | ], |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 91 | nested_types=[], |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 92 | enum_types=[ |
| 93 | ], |
| 94 | options=None, |
| 95 | is_extendable=False, |
| 96 | syntax='proto3', |
| 97 | extension_ranges=[], |
| 98 | oneofs=[ |
| 99 | ], |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 100 | serialized_start=91, |
| 101 | serialized_end=135, |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 102 | ) |
| 103 | |
| 104 | |
| 105 | _NULLMESSAGE = _descriptor.Descriptor( |
| 106 | name='NullMessage', |
| 107 | full_name='schema.NullMessage', |
| 108 | filename=None, |
| 109 | file=DESCRIPTOR, |
| 110 | containing_type=None, |
| 111 | fields=[ |
| 112 | ], |
| 113 | extensions=[ |
| 114 | ], |
| 115 | nested_types=[], |
| 116 | enum_types=[ |
| 117 | ], |
| 118 | options=None, |
| 119 | is_extendable=False, |
| 120 | syntax='proto3', |
| 121 | extension_ranges=[], |
| 122 | oneofs=[ |
| 123 | ], |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 124 | serialized_start=137, |
| 125 | serialized_end=150, |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 126 | ) |
| 127 | |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 128 | _SCHEMAS.fields_by_name['protos'].message_type = _PROTOFILE |
| 129 | DESCRIPTOR.message_types_by_name['ProtoFile'] = _PROTOFILE |
| 130 | DESCRIPTOR.message_types_by_name['Schemas'] = _SCHEMAS |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 131 | DESCRIPTOR.message_types_by_name['NullMessage'] = _NULLMESSAGE |
| 132 | |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 133 | ProtoFile = _reflection.GeneratedProtocolMessageType('ProtoFile', (_message.Message,), dict( |
| 134 | DESCRIPTOR = _PROTOFILE, |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 135 | __module__ = 'schema_pb2' |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 136 | # @@protoc_insertion_point(class_scope:schema.ProtoFile) |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 137 | )) |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 138 | _sym_db.RegisterMessage(ProtoFile) |
| 139 | |
| 140 | Schemas = _reflection.GeneratedProtocolMessageType('Schemas', (_message.Message,), dict( |
| 141 | DESCRIPTOR = _SCHEMAS, |
| 142 | __module__ = 'schema_pb2' |
| 143 | # @@protoc_insertion_point(class_scope:schema.Schemas) |
| 144 | )) |
| 145 | _sym_db.RegisterMessage(Schemas) |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 146 | |
| 147 | NullMessage = _reflection.GeneratedProtocolMessageType('NullMessage', (_message.Message,), dict( |
| 148 | DESCRIPTOR = _NULLMESSAGE, |
| 149 | __module__ = 'schema_pb2' |
| 150 | # @@protoc_insertion_point(class_scope:schema.NullMessage) |
| 151 | )) |
| 152 | _sym_db.RegisterMessage(NullMessage) |
| 153 | |
| 154 | |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 155 | import grpc |
| 156 | from grpc.beta import implementations as beta_implementations |
| 157 | from grpc.beta import interfaces as beta_interfaces |
| 158 | from grpc.framework.common import cardinality |
| 159 | from grpc.framework.interfaces.face import utilities as face_utilities |
| 160 | |
| 161 | |
| 162 | class SchemaServiceStub(object): |
| 163 | """Schema services |
| 164 | """ |
| 165 | |
| 166 | def __init__(self, channel): |
| 167 | """Constructor. |
| 168 | |
| 169 | Args: |
| 170 | channel: A grpc.Channel. |
| 171 | """ |
| 172 | self.GetSchema = channel.unary_unary( |
| 173 | '/schema.SchemaService/GetSchema', |
| 174 | request_serializer=NullMessage.SerializeToString, |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 175 | response_deserializer=Schemas.FromString, |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 176 | ) |
| 177 | |
| 178 | |
| 179 | class SchemaServiceServicer(object): |
| 180 | """Schema services |
| 181 | """ |
| 182 | |
| 183 | def GetSchema(self, request, context): |
| 184 | """Return active grpc schemas |
| 185 | """ |
| 186 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 187 | context.set_details('Method not implemented!') |
| 188 | raise NotImplementedError('Method not implemented!') |
| 189 | |
| 190 | |
| 191 | def add_SchemaServiceServicer_to_server(servicer, server): |
| 192 | rpc_method_handlers = { |
| 193 | 'GetSchema': grpc.unary_unary_rpc_method_handler( |
| 194 | servicer.GetSchema, |
| 195 | request_deserializer=NullMessage.FromString, |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 196 | response_serializer=Schemas.SerializeToString, |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 197 | ), |
| 198 | } |
| 199 | generic_handler = grpc.method_handlers_generic_handler( |
| 200 | 'schema.SchemaService', rpc_method_handlers) |
| 201 | server.add_generic_rpc_handlers((generic_handler,)) |
| 202 | |
| 203 | |
| 204 | class BetaSchemaServiceServicer(object): |
| 205 | """Schema services |
| 206 | """ |
| 207 | def GetSchema(self, request, context): |
| 208 | """Return active grpc schemas |
| 209 | """ |
| 210 | context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) |
| 211 | |
| 212 | |
| 213 | class BetaSchemaServiceStub(object): |
| 214 | """Schema services |
| 215 | """ |
| 216 | def GetSchema(self, request, timeout, metadata=None, with_call=False, protocol_options=None): |
| 217 | """Return active grpc schemas |
| 218 | """ |
| 219 | raise NotImplementedError() |
| 220 | GetSchema.future = None |
| 221 | |
| 222 | |
| 223 | def beta_create_SchemaService_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): |
| 224 | request_deserializers = { |
| 225 | ('schema.SchemaService', 'GetSchema'): NullMessage.FromString, |
| 226 | } |
| 227 | response_serializers = { |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 228 | ('schema.SchemaService', 'GetSchema'): Schemas.SerializeToString, |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 229 | } |
| 230 | method_implementations = { |
| 231 | ('schema.SchemaService', 'GetSchema'): face_utilities.unary_unary_inline(servicer.GetSchema), |
| 232 | } |
| 233 | server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) |
| 234 | return beta_implementations.server(method_implementations, options=server_options) |
| 235 | |
| 236 | |
| 237 | def beta_create_SchemaService_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): |
| 238 | request_serializers = { |
| 239 | ('schema.SchemaService', 'GetSchema'): NullMessage.SerializeToString, |
| 240 | } |
| 241 | response_deserializers = { |
Zsolt Haraszti | 2bdb6b3 | 2016-11-03 16:56:17 -0700 | [diff] [blame^] | 242 | ('schema.SchemaService', 'GetSchema'): Schemas.FromString, |
Zsolt Haraszti | 034db37 | 2016-10-03 22:26:41 -0700 | [diff] [blame] | 243 | } |
| 244 | cardinalities = { |
| 245 | 'GetSchema': cardinality.Cardinality.UNARY_UNARY, |
| 246 | } |
| 247 | stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) |
| 248 | return beta_implementations.dynamic_stub(channel, 'schema.SchemaService', cardinalities, options=stub_options) |
| 249 | # @@protoc_insertion_point(module_scope) |