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 | |
Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 30 | |
| 31 | cdef class Timespec: |
| 32 | |
Masood Malekghassemi | 116982e | 2015-12-11 15:53:38 -0800 | [diff] [blame] | 33 | cdef gpr_timespec c_time |
Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 34 | |
| 35 | |
| 36 | cdef class CallDetails: |
| 37 | |
Masood Malekghassemi | 116982e | 2015-12-11 15:53:38 -0800 | [diff] [blame] | 38 | cdef grpc_call_details c_details |
Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 39 | |
| 40 | |
| 41 | cdef class OperationTag: |
| 42 | |
| 43 | cdef object user_tag |
| 44 | cdef list references |
| 45 | # This allows CompletionQueue to notify the Python Server object that the |
| 46 | # underlying GRPC core server has shutdown |
Masood Malekghassemi | 116982e | 2015-12-11 15:53:38 -0800 | [diff] [blame] | 47 | cdef Server shutting_down_server |
| 48 | cdef Call operation_call |
Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 49 | cdef CallDetails request_call_details |
| 50 | cdef Metadata request_metadata |
| 51 | cdef Operations batch_operations |
| 52 | cdef bint is_new_request |
| 53 | |
| 54 | |
| 55 | cdef class Event: |
| 56 | |
Masood Malekghassemi | 116982e | 2015-12-11 15:53:38 -0800 | [diff] [blame] | 57 | cdef readonly grpc_completion_type type |
Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 58 | cdef readonly bint success |
| 59 | cdef readonly object tag |
| 60 | |
Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 61 | # For Server.request_call |
Masood Malekghassemi | aed42a8 | 2015-12-07 16:35:40 -0800 | [diff] [blame] | 62 | cdef readonly bint is_new_request |
Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 63 | cdef readonly CallDetails request_call_details |
| 64 | cdef readonly Metadata request_metadata |
| 65 | |
Ken Payson | ea1b16f | 2016-07-07 16:44:33 -0700 | [diff] [blame] | 66 | # For server calls |
| 67 | cdef readonly Call operation_call |
| 68 | |
Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 69 | # For Call.start_batch |
| 70 | cdef readonly Operations batch_operations |
| 71 | |
| 72 | |
| 73 | cdef class ByteBuffer: |
| 74 | |
Masood Malekghassemi | 116982e | 2015-12-11 15:53:38 -0800 | [diff] [blame] | 75 | cdef grpc_byte_buffer *c_byte_buffer |
Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 76 | |
| 77 | |
| 78 | cdef class SslPemKeyCertPair: |
| 79 | |
Masood Malekghassemi | 116982e | 2015-12-11 15:53:38 -0800 | [diff] [blame] | 80 | cdef grpc_ssl_pem_key_cert_pair c_pair |
Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 81 | cdef readonly object private_key, certificate_chain |
| 82 | |
| 83 | |
| 84 | cdef class ChannelArg: |
| 85 | |
Masood Malekghassemi | 116982e | 2015-12-11 15:53:38 -0800 | [diff] [blame] | 86 | cdef grpc_arg c_arg |
Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 87 | cdef readonly object key, value |
| 88 | |
| 89 | |
| 90 | cdef class ChannelArgs: |
| 91 | |
Masood Malekghassemi | 116982e | 2015-12-11 15:53:38 -0800 | [diff] [blame] | 92 | cdef grpc_channel_args c_args |
Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 93 | cdef list args |
| 94 | |
| 95 | |
| 96 | cdef class Metadatum: |
| 97 | |
Masood Malekghassemi | 116982e | 2015-12-11 15:53:38 -0800 | [diff] [blame] | 98 | cdef grpc_metadata c_metadata |
Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 99 | cdef object _key, _value |
| 100 | |
| 101 | |
| 102 | cdef class Metadata: |
| 103 | |
Masood Malekghassemi | 116982e | 2015-12-11 15:53:38 -0800 | [diff] [blame] | 104 | cdef grpc_metadata_array c_metadata_array |
Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 105 | cdef object metadata |
| 106 | |
| 107 | |
| 108 | cdef class Operation: |
| 109 | |
Masood Malekghassemi | 116982e | 2015-12-11 15:53:38 -0800 | [diff] [blame] | 110 | cdef grpc_op c_op |
Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 111 | cdef ByteBuffer _received_message |
| 112 | cdef Metadata _received_metadata |
Masood Malekghassemi | 116982e | 2015-12-11 15:53:38 -0800 | [diff] [blame] | 113 | cdef grpc_status_code _received_status_code |
Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 114 | cdef char *_received_status_details |
| 115 | cdef size_t _received_status_details_capacity |
| 116 | cdef int _received_cancelled |
| 117 | cdef readonly bint is_valid |
| 118 | cdef object references |
| 119 | |
| 120 | |
| 121 | cdef class Operations: |
| 122 | |
Masood Malekghassemi | 116982e | 2015-12-11 15:53:38 -0800 | [diff] [blame] | 123 | cdef grpc_op *c_ops |
Masood Malekghassemi | 743c10c | 2015-06-16 18:05:27 -0700 | [diff] [blame] | 124 | cdef size_t c_nops |
| 125 | cdef list operations |
| 126 | |
Masood Malekghassemi | 93cc06a | 2016-05-13 14:25:35 -0700 | [diff] [blame] | 127 | |
| 128 | cdef class CompressionOptions: |
| 129 | |
| 130 | cdef grpc_compression_options c_options |