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