blob: 4c844e4cb6cd8be385a1ff82f168ff63fdb93464 [file] [log] [blame]
Masood Malekghassemi743c10c2015-06-16 18:05:27 -07001# 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
30from grpc._cython._cygrpc cimport grpc
31from grpc._cython._cygrpc cimport call
32from grpc._cython._cygrpc cimport server
33
34
35cdef class Timespec:
36
37 cdef grpc.gpr_timespec c_time
38
39
40cdef class CallDetails:
41
42 cdef grpc.grpc_call_details c_details
43
44
45cdef 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
59cdef 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
Masood Malekghassemiaed42a82015-12-07 16:35:40 -080069 cdef readonly bint is_new_request
Masood Malekghassemi743c10c2015-06-16 18:05:27 -070070 cdef readonly CallDetails request_call_details
71 cdef readonly Metadata request_metadata
72
73 # For Call.start_batch
74 cdef readonly Operations batch_operations
75
76
77cdef class ByteBuffer:
78
79 cdef grpc.grpc_byte_buffer *c_byte_buffer
80
81
82cdef class SslPemKeyCertPair:
83
84 cdef grpc.grpc_ssl_pem_key_cert_pair c_pair
85 cdef readonly object private_key, certificate_chain
86
87
88cdef class ChannelArg:
89
90 cdef grpc.grpc_arg c_arg
91 cdef readonly object key, value
92
93
94cdef class ChannelArgs:
95
96 cdef grpc.grpc_channel_args c_args
97 cdef list args
98
99
100cdef class Metadatum:
101
102 cdef grpc.grpc_metadata c_metadata
103 cdef object _key, _value
104
105
106cdef class Metadata:
107
108 cdef grpc.grpc_metadata_array c_metadata_array
109 cdef object metadata
110
111
112cdef class Operation:
113
114 cdef grpc.grpc_op c_op
115 cdef ByteBuffer _received_message
116 cdef Metadata _received_metadata
117 cdef grpc.grpc_status_code _received_status_code
118 cdef char *_received_status_details
119 cdef size_t _received_status_details_capacity
120 cdef int _received_cancelled
121 cdef readonly bint is_valid
122 cdef object references
123
124
125cdef class Operations:
126
127 cdef grpc.grpc_op *c_ops
128 cdef size_t c_nops
129 cdef list operations
130