Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 1 | # Copyright 2015, Google Inc. |
| 2 | # All rights reserved. |
| 3 | # |
| 4 | # Redistribution and use in source and binary forms, with or without |
| 5 | # modification, are permitted provided that the following conditions are |
| 6 | # met: |
| 7 | # |
| 8 | # * Redistributions of source code must retain the above copyright |
| 9 | # notice, this list of conditions and the following disclaimer. |
| 10 | # * Redistributions in binary form must reproduce the above |
| 11 | # copyright notice, this list of conditions and the following disclaimer |
| 12 | # in the documentation and/or other materials provided with the |
| 13 | # distribution. |
| 14 | # * Neither the name of Google Inc. nor the names of its |
| 15 | # contributors may be used to endorse or promote products derived from |
| 16 | # this software without specific prior written permission. |
| 17 | # |
| 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | |
| 30 | from grpc._cython._cygrpc cimport grpc |
| 31 | from grpc._cython._cygrpc cimport call |
| 32 | from grpc._cython._cygrpc cimport server |
| 33 | |
| 34 | |
| 35 | cdef class Timespec: |
| 36 | |
| 37 | cdef grpc.gpr_timespec c_time |
| 38 | |
| 39 | |
| 40 | cdef class CallDetails: |
| 41 | |
| 42 | cdef grpc.grpc_call_details c_details |
| 43 | |
| 44 | |
| 45 | cdef class OperationTag: |
| 46 | |
| 47 | cdef object user_tag |
| 48 | cdef list references |
| 49 | # This allows CompletionQueue to notify the Python Server object that the |
| 50 | # underlying GRPC core server has shutdown |
| 51 | cdef server.Server shutting_down_server |
| 52 | cdef call.Call operation_call |
| 53 | cdef CallDetails request_call_details |
| 54 | cdef Metadata request_metadata |
| 55 | cdef Operations batch_operations |
| 56 | cdef bint is_new_request |
| 57 | |
| 58 | |
| 59 | cdef class Event: |
| 60 | |
| 61 | cdef readonly grpc.grpc_completion_type type |
| 62 | cdef readonly bint success |
| 63 | cdef readonly object tag |
| 64 | |
| 65 | # For operations with calls |
| 66 | cdef readonly call.Call operation_call |
| 67 | |
| 68 | # For Server.request_call |
| 69 | cdef readonly CallDetails request_call_details |
| 70 | cdef readonly Metadata request_metadata |
| 71 | |
| 72 | # For Call.start_batch |
| 73 | cdef readonly Operations batch_operations |
| 74 | |
| 75 | |
| 76 | cdef class ByteBuffer: |
| 77 | |
| 78 | cdef grpc.grpc_byte_buffer *c_byte_buffer |
| 79 | |
| 80 | |
| 81 | cdef class SslPemKeyCertPair: |
| 82 | |
| 83 | cdef grpc.grpc_ssl_pem_key_cert_pair c_pair |
| 84 | cdef readonly object private_key, certificate_chain |
| 85 | |
| 86 | |
| 87 | cdef class ChannelArg: |
| 88 | |
| 89 | cdef grpc.grpc_arg c_arg |
| 90 | cdef readonly object key, value |
| 91 | |
| 92 | |
| 93 | cdef class ChannelArgs: |
| 94 | |
| 95 | cdef grpc.grpc_channel_args c_args |
| 96 | cdef list args |
| 97 | |
| 98 | |
| 99 | cdef class Metadatum: |
| 100 | |
| 101 | cdef grpc.grpc_metadata c_metadata |
| 102 | cdef object _key, _value |
| 103 | |
| 104 | |
| 105 | cdef class Metadata: |
| 106 | |
| 107 | cdef grpc.grpc_metadata_array c_metadata_array |
| 108 | cdef object metadata |
| 109 | |
| 110 | |
| 111 | cdef class Operation: |
| 112 | |
| 113 | cdef grpc.grpc_op c_op |
| 114 | cdef ByteBuffer _received_message |
| 115 | cdef Metadata _received_metadata |
| 116 | cdef grpc.grpc_status_code _received_status_code |
| 117 | cdef char *_received_status_details |
| 118 | cdef size_t _received_status_details_capacity |
| 119 | cdef int _received_cancelled |
| 120 | cdef readonly bint is_valid |
| 121 | cdef object references |
| 122 | |
| 123 | |
| 124 | cdef class Operations: |
| 125 | |
| 126 | cdef grpc.grpc_op *c_ops |
| 127 | cdef size_t c_nops |
| 128 | cdef list operations |
| 129 | |