├── README.md ├── bindings ├── cpp │ ├── coprocess_common.pb.cc │ ├── coprocess_common.pb.h │ ├── coprocess_mini_request_object.pb.cc │ ├── coprocess_mini_request_object.pb.h │ ├── coprocess_object.pb.cc │ ├── coprocess_object.pb.h │ ├── coprocess_return_overrides.pb.cc │ ├── coprocess_return_overrides.pb.h │ ├── coprocess_session_state.pb.cc │ └── coprocess_session_state.pb.h ├── java │ ├── CoprocessCommon.java │ ├── CoprocessMiniRequestObject.java │ ├── CoprocessObject.java │ ├── CoprocessReturnOverrides.java │ ├── CoprocessSessionState.java │ └── DispatcherGrpc.java ├── python │ ├── .gitignore │ ├── coprocess_common_pb2.py │ ├── coprocess_grpc_pb2.py │ ├── coprocess_mini_request_object_pb2.py │ ├── coprocess_object_pb2.py │ ├── coprocess_object_pb2_grpc.py │ ├── coprocess_response_object_pb2.py │ ├── coprocess_return_overrides_pb2.py │ ├── coprocess_session_state_pb2.py │ └── sample_server.py └── ruby │ ├── coprocess_common_pb.rb │ ├── coprocess_mini_request_object_pb.rb │ ├── coprocess_object_pb.rb │ ├── coprocess_response_object_pb.rb │ ├── coprocess_return_overrides_pb.rb │ ├── coprocess_session_state_pb.rb │ └── dispatcher.rb ├── coprocess_common.pb.go ├── coprocess_mini_request_object.pb.go ├── coprocess_object.pb.go ├── coprocess_response_object.pb.go ├── coprocess_return_overrides.pb.go ├── coprocess_session_state.pb.go └── proto ├── codegen.py ├── coprocess_common.proto ├── coprocess_mini_request_object.proto ├── coprocess_object.proto ├── coprocess_response_object.proto ├── coprocess_return_overrides.proto ├── coprocess_session_state.proto └── update_bindings.sh /README.md: -------------------------------------------------------------------------------- 1 | ## DEPRECATED 2 | 3 | Instead use: 4 | 5 | https://github.com/TykTechnologies/tyk/tree/master/coprocess/proto 6 | https://github.com/TykTechnologies/tyk/tree/master/coprocess/bindings 7 | -------------------------------------------------------------------------------- /bindings/cpp/coprocess_common.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: coprocess_common.proto 3 | 4 | #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION 5 | #include "coprocess_common.pb.h" 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | // @@protoc_insertion_point(includes) 19 | 20 | namespace coprocess { 21 | 22 | namespace { 23 | 24 | const ::google::protobuf::Descriptor* StringSlice_descriptor_ = NULL; 25 | const ::google::protobuf::internal::GeneratedMessageReflection* 26 | StringSlice_reflection_ = NULL; 27 | const ::google::protobuf::EnumDescriptor* HookType_descriptor_ = NULL; 28 | 29 | } // namespace 30 | 31 | 32 | void protobuf_AssignDesc_coprocess_5fcommon_2eproto() GOOGLE_ATTRIBUTE_COLD; 33 | void protobuf_AssignDesc_coprocess_5fcommon_2eproto() { 34 | protobuf_AddDesc_coprocess_5fcommon_2eproto(); 35 | const ::google::protobuf::FileDescriptor* file = 36 | ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( 37 | "coprocess_common.proto"); 38 | GOOGLE_CHECK(file != NULL); 39 | StringSlice_descriptor_ = file->message_type(0); 40 | static const int StringSlice_offsets_[1] = { 41 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(StringSlice, items_), 42 | }; 43 | StringSlice_reflection_ = 44 | ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( 45 | StringSlice_descriptor_, 46 | StringSlice::internal_default_instance(), 47 | StringSlice_offsets_, 48 | -1, 49 | -1, 50 | -1, 51 | sizeof(StringSlice), 52 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(StringSlice, _internal_metadata_)); 53 | HookType_descriptor_ = file->enum_type(0); 54 | } 55 | 56 | namespace { 57 | 58 | GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); 59 | void protobuf_AssignDescriptorsOnce() { 60 | ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, 61 | &protobuf_AssignDesc_coprocess_5fcommon_2eproto); 62 | } 63 | 64 | void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; 65 | void protobuf_RegisterTypes(const ::std::string&) { 66 | protobuf_AssignDescriptorsOnce(); 67 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( 68 | StringSlice_descriptor_, StringSlice::internal_default_instance()); 69 | } 70 | 71 | } // namespace 72 | 73 | void protobuf_ShutdownFile_coprocess_5fcommon_2eproto() { 74 | StringSlice_default_instance_.Shutdown(); 75 | delete StringSlice_reflection_; 76 | } 77 | 78 | void protobuf_InitDefaults_coprocess_5fcommon_2eproto_impl() { 79 | GOOGLE_PROTOBUF_VERIFY_VERSION; 80 | 81 | ::google::protobuf::internal::GetEmptyString(); 82 | StringSlice_default_instance_.DefaultConstruct(); 83 | StringSlice_default_instance_.get_mutable()->InitAsDefaultInstance(); 84 | } 85 | 86 | GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_InitDefaults_coprocess_5fcommon_2eproto_once_); 87 | void protobuf_InitDefaults_coprocess_5fcommon_2eproto() { 88 | ::google::protobuf::GoogleOnceInit(&protobuf_InitDefaults_coprocess_5fcommon_2eproto_once_, 89 | &protobuf_InitDefaults_coprocess_5fcommon_2eproto_impl); 90 | } 91 | void protobuf_AddDesc_coprocess_5fcommon_2eproto_impl() { 92 | GOOGLE_PROTOBUF_VERIFY_VERSION; 93 | 94 | protobuf_InitDefaults_coprocess_5fcommon_2eproto(); 95 | ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( 96 | "\n\026coprocess_common.proto\022\tcoprocess\"\034\n\013S" 97 | "tringSlice\022\r\n\005items\030\001 \003(\t*O\n\010HookType\022\013\n" 98 | "\007Unknown\020\000\022\007\n\003Pre\020\001\022\010\n\004Post\020\002\022\017\n\013PostKey" 99 | "Auth\020\003\022\022\n\016CustomKeyCheck\020\004b\006proto3", 154); 100 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( 101 | "coprocess_common.proto", &protobuf_RegisterTypes); 102 | ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_coprocess_5fcommon_2eproto); 103 | } 104 | 105 | GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_coprocess_5fcommon_2eproto_once_); 106 | void protobuf_AddDesc_coprocess_5fcommon_2eproto() { 107 | ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_coprocess_5fcommon_2eproto_once_, 108 | &protobuf_AddDesc_coprocess_5fcommon_2eproto_impl); 109 | } 110 | // Force AddDescriptors() to be called at static initialization time. 111 | struct StaticDescriptorInitializer_coprocess_5fcommon_2eproto { 112 | StaticDescriptorInitializer_coprocess_5fcommon_2eproto() { 113 | protobuf_AddDesc_coprocess_5fcommon_2eproto(); 114 | } 115 | } static_descriptor_initializer_coprocess_5fcommon_2eproto_; 116 | const ::google::protobuf::EnumDescriptor* HookType_descriptor() { 117 | protobuf_AssignDescriptorsOnce(); 118 | return HookType_descriptor_; 119 | } 120 | bool HookType_IsValid(int value) { 121 | switch (value) { 122 | case 0: 123 | case 1: 124 | case 2: 125 | case 3: 126 | case 4: 127 | return true; 128 | default: 129 | return false; 130 | } 131 | } 132 | 133 | 134 | namespace { 135 | 136 | static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_NORETURN; 137 | static void MergeFromFail(int line) { 138 | ::google::protobuf::internal::MergeFromFail(__FILE__, line); 139 | } 140 | 141 | } // namespace 142 | 143 | 144 | // =================================================================== 145 | 146 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 147 | const int StringSlice::kItemsFieldNumber; 148 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 149 | 150 | StringSlice::StringSlice() 151 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { 152 | if (this != internal_default_instance()) protobuf_InitDefaults_coprocess_5fcommon_2eproto(); 153 | SharedCtor(); 154 | // @@protoc_insertion_point(constructor:coprocess.StringSlice) 155 | } 156 | 157 | void StringSlice::InitAsDefaultInstance() { 158 | } 159 | 160 | StringSlice::StringSlice(const StringSlice& from) 161 | : ::google::protobuf::Message(), 162 | _internal_metadata_(NULL) { 163 | SharedCtor(); 164 | UnsafeMergeFrom(from); 165 | // @@protoc_insertion_point(copy_constructor:coprocess.StringSlice) 166 | } 167 | 168 | void StringSlice::SharedCtor() { 169 | _cached_size_ = 0; 170 | } 171 | 172 | StringSlice::~StringSlice() { 173 | // @@protoc_insertion_point(destructor:coprocess.StringSlice) 174 | SharedDtor(); 175 | } 176 | 177 | void StringSlice::SharedDtor() { 178 | } 179 | 180 | void StringSlice::SetCachedSize(int size) const { 181 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 182 | _cached_size_ = size; 183 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 184 | } 185 | const ::google::protobuf::Descriptor* StringSlice::descriptor() { 186 | protobuf_AssignDescriptorsOnce(); 187 | return StringSlice_descriptor_; 188 | } 189 | 190 | const StringSlice& StringSlice::default_instance() { 191 | protobuf_InitDefaults_coprocess_5fcommon_2eproto(); 192 | return *internal_default_instance(); 193 | } 194 | 195 | ::google::protobuf::internal::ExplicitlyConstructed StringSlice_default_instance_; 196 | 197 | StringSlice* StringSlice::New(::google::protobuf::Arena* arena) const { 198 | StringSlice* n = new StringSlice; 199 | if (arena != NULL) { 200 | arena->Own(n); 201 | } 202 | return n; 203 | } 204 | 205 | void StringSlice::Clear() { 206 | // @@protoc_insertion_point(message_clear_start:coprocess.StringSlice) 207 | items_.Clear(); 208 | } 209 | 210 | bool StringSlice::MergePartialFromCodedStream( 211 | ::google::protobuf::io::CodedInputStream* input) { 212 | #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure 213 | ::google::protobuf::uint32 tag; 214 | // @@protoc_insertion_point(parse_start:coprocess.StringSlice) 215 | for (;;) { 216 | ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); 217 | tag = p.first; 218 | if (!p.second) goto handle_unusual; 219 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 220 | // repeated string items = 1; 221 | case 1: { 222 | if (tag == 10) { 223 | parse_items: 224 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( 225 | input, this->add_items())); 226 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 227 | this->items(this->items_size() - 1).data(), 228 | this->items(this->items_size() - 1).length(), 229 | ::google::protobuf::internal::WireFormatLite::PARSE, 230 | "coprocess.StringSlice.items")); 231 | } else { 232 | goto handle_unusual; 233 | } 234 | if (input->ExpectTag(10)) goto parse_items; 235 | if (input->ExpectAtEnd()) goto success; 236 | break; 237 | } 238 | 239 | default: { 240 | handle_unusual: 241 | if (tag == 0 || 242 | ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == 243 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { 244 | goto success; 245 | } 246 | DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); 247 | break; 248 | } 249 | } 250 | } 251 | success: 252 | // @@protoc_insertion_point(parse_success:coprocess.StringSlice) 253 | return true; 254 | failure: 255 | // @@protoc_insertion_point(parse_failure:coprocess.StringSlice) 256 | return false; 257 | #undef DO_ 258 | } 259 | 260 | void StringSlice::SerializeWithCachedSizes( 261 | ::google::protobuf::io::CodedOutputStream* output) const { 262 | // @@protoc_insertion_point(serialize_start:coprocess.StringSlice) 263 | // repeated string items = 1; 264 | for (int i = 0; i < this->items_size(); i++) { 265 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 266 | this->items(i).data(), this->items(i).length(), 267 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 268 | "coprocess.StringSlice.items"); 269 | ::google::protobuf::internal::WireFormatLite::WriteString( 270 | 1, this->items(i), output); 271 | } 272 | 273 | // @@protoc_insertion_point(serialize_end:coprocess.StringSlice) 274 | } 275 | 276 | ::google::protobuf::uint8* StringSlice::InternalSerializeWithCachedSizesToArray( 277 | bool deterministic, ::google::protobuf::uint8* target) const { 278 | (void)deterministic; // Unused 279 | // @@protoc_insertion_point(serialize_to_array_start:coprocess.StringSlice) 280 | // repeated string items = 1; 281 | for (int i = 0; i < this->items_size(); i++) { 282 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 283 | this->items(i).data(), this->items(i).length(), 284 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 285 | "coprocess.StringSlice.items"); 286 | target = ::google::protobuf::internal::WireFormatLite:: 287 | WriteStringToArray(1, this->items(i), target); 288 | } 289 | 290 | // @@protoc_insertion_point(serialize_to_array_end:coprocess.StringSlice) 291 | return target; 292 | } 293 | 294 | size_t StringSlice::ByteSizeLong() const { 295 | // @@protoc_insertion_point(message_byte_size_start:coprocess.StringSlice) 296 | size_t total_size = 0; 297 | 298 | // repeated string items = 1; 299 | total_size += 1 * 300 | ::google::protobuf::internal::FromIntSize(this->items_size()); 301 | for (int i = 0; i < this->items_size(); i++) { 302 | total_size += ::google::protobuf::internal::WireFormatLite::StringSize( 303 | this->items(i)); 304 | } 305 | 306 | int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); 307 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 308 | _cached_size_ = cached_size; 309 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 310 | return total_size; 311 | } 312 | 313 | void StringSlice::MergeFrom(const ::google::protobuf::Message& from) { 314 | // @@protoc_insertion_point(generalized_merge_from_start:coprocess.StringSlice) 315 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); 316 | const StringSlice* source = 317 | ::google::protobuf::internal::DynamicCastToGenerated( 318 | &from); 319 | if (source == NULL) { 320 | // @@protoc_insertion_point(generalized_merge_from_cast_fail:coprocess.StringSlice) 321 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); 322 | } else { 323 | // @@protoc_insertion_point(generalized_merge_from_cast_success:coprocess.StringSlice) 324 | UnsafeMergeFrom(*source); 325 | } 326 | } 327 | 328 | void StringSlice::MergeFrom(const StringSlice& from) { 329 | // @@protoc_insertion_point(class_specific_merge_from_start:coprocess.StringSlice) 330 | if (GOOGLE_PREDICT_TRUE(&from != this)) { 331 | UnsafeMergeFrom(from); 332 | } else { 333 | MergeFromFail(__LINE__); 334 | } 335 | } 336 | 337 | void StringSlice::UnsafeMergeFrom(const StringSlice& from) { 338 | GOOGLE_DCHECK(&from != this); 339 | items_.UnsafeMergeFrom(from.items_); 340 | } 341 | 342 | void StringSlice::CopyFrom(const ::google::protobuf::Message& from) { 343 | // @@protoc_insertion_point(generalized_copy_from_start:coprocess.StringSlice) 344 | if (&from == this) return; 345 | Clear(); 346 | MergeFrom(from); 347 | } 348 | 349 | void StringSlice::CopyFrom(const StringSlice& from) { 350 | // @@protoc_insertion_point(class_specific_copy_from_start:coprocess.StringSlice) 351 | if (&from == this) return; 352 | Clear(); 353 | UnsafeMergeFrom(from); 354 | } 355 | 356 | bool StringSlice::IsInitialized() const { 357 | 358 | return true; 359 | } 360 | 361 | void StringSlice::Swap(StringSlice* other) { 362 | if (other == this) return; 363 | InternalSwap(other); 364 | } 365 | void StringSlice::InternalSwap(StringSlice* other) { 366 | items_.UnsafeArenaSwap(&other->items_); 367 | _internal_metadata_.Swap(&other->_internal_metadata_); 368 | std::swap(_cached_size_, other->_cached_size_); 369 | } 370 | 371 | ::google::protobuf::Metadata StringSlice::GetMetadata() const { 372 | protobuf_AssignDescriptorsOnce(); 373 | ::google::protobuf::Metadata metadata; 374 | metadata.descriptor = StringSlice_descriptor_; 375 | metadata.reflection = StringSlice_reflection_; 376 | return metadata; 377 | } 378 | 379 | #if PROTOBUF_INLINE_NOT_IN_HEADERS 380 | // StringSlice 381 | 382 | // repeated string items = 1; 383 | int StringSlice::items_size() const { 384 | return items_.size(); 385 | } 386 | void StringSlice::clear_items() { 387 | items_.Clear(); 388 | } 389 | const ::std::string& StringSlice::items(int index) const { 390 | // @@protoc_insertion_point(field_get:coprocess.StringSlice.items) 391 | return items_.Get(index); 392 | } 393 | ::std::string* StringSlice::mutable_items(int index) { 394 | // @@protoc_insertion_point(field_mutable:coprocess.StringSlice.items) 395 | return items_.Mutable(index); 396 | } 397 | void StringSlice::set_items(int index, const ::std::string& value) { 398 | // @@protoc_insertion_point(field_set:coprocess.StringSlice.items) 399 | items_.Mutable(index)->assign(value); 400 | } 401 | void StringSlice::set_items(int index, const char* value) { 402 | items_.Mutable(index)->assign(value); 403 | // @@protoc_insertion_point(field_set_char:coprocess.StringSlice.items) 404 | } 405 | void StringSlice::set_items(int index, const char* value, size_t size) { 406 | items_.Mutable(index)->assign( 407 | reinterpret_cast(value), size); 408 | // @@protoc_insertion_point(field_set_pointer:coprocess.StringSlice.items) 409 | } 410 | ::std::string* StringSlice::add_items() { 411 | // @@protoc_insertion_point(field_add_mutable:coprocess.StringSlice.items) 412 | return items_.Add(); 413 | } 414 | void StringSlice::add_items(const ::std::string& value) { 415 | items_.Add()->assign(value); 416 | // @@protoc_insertion_point(field_add:coprocess.StringSlice.items) 417 | } 418 | void StringSlice::add_items(const char* value) { 419 | items_.Add()->assign(value); 420 | // @@protoc_insertion_point(field_add_char:coprocess.StringSlice.items) 421 | } 422 | void StringSlice::add_items(const char* value, size_t size) { 423 | items_.Add()->assign(reinterpret_cast(value), size); 424 | // @@protoc_insertion_point(field_add_pointer:coprocess.StringSlice.items) 425 | } 426 | const ::google::protobuf::RepeatedPtrField< ::std::string>& 427 | StringSlice::items() const { 428 | // @@protoc_insertion_point(field_list:coprocess.StringSlice.items) 429 | return items_; 430 | } 431 | ::google::protobuf::RepeatedPtrField< ::std::string>* 432 | StringSlice::mutable_items() { 433 | // @@protoc_insertion_point(field_mutable_list:coprocess.StringSlice.items) 434 | return &items_; 435 | } 436 | 437 | inline const StringSlice* StringSlice::internal_default_instance() { 438 | return &StringSlice_default_instance_.get(); 439 | } 440 | #endif // PROTOBUF_INLINE_NOT_IN_HEADERS 441 | 442 | // @@protoc_insertion_point(namespace_scope) 443 | 444 | } // namespace coprocess 445 | 446 | // @@protoc_insertion_point(global_scope) 447 | -------------------------------------------------------------------------------- /bindings/cpp/coprocess_common.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: coprocess_common.proto 3 | 4 | #ifndef PROTOBUF_coprocess_5fcommon_2eproto__INCLUDED 5 | #define PROTOBUF_coprocess_5fcommon_2eproto__INCLUDED 6 | 7 | #include 8 | 9 | #include 10 | 11 | #if GOOGLE_PROTOBUF_VERSION < 3001000 12 | #error This file was generated by a newer version of protoc which is 13 | #error incompatible with your Protocol Buffer headers. Please update 14 | #error your headers. 15 | #endif 16 | #if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 17 | #error This file was generated by an older version of protoc which is 18 | #error incompatible with your Protocol Buffer headers. Please 19 | #error regenerate this file with a newer version of protoc. 20 | #endif 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | // @@protoc_insertion_point(includes) 32 | 33 | namespace coprocess { 34 | 35 | // Internal implementation detail -- do not call these. 36 | void protobuf_AddDesc_coprocess_5fcommon_2eproto(); 37 | void protobuf_InitDefaults_coprocess_5fcommon_2eproto(); 38 | void protobuf_AssignDesc_coprocess_5fcommon_2eproto(); 39 | void protobuf_ShutdownFile_coprocess_5fcommon_2eproto(); 40 | 41 | class StringSlice; 42 | 43 | enum HookType { 44 | Unknown = 0, 45 | Pre = 1, 46 | Post = 2, 47 | PostKeyAuth = 3, 48 | CustomKeyCheck = 4, 49 | HookType_INT_MIN_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32min, 50 | HookType_INT_MAX_SENTINEL_DO_NOT_USE_ = ::google::protobuf::kint32max 51 | }; 52 | bool HookType_IsValid(int value); 53 | const HookType HookType_MIN = Unknown; 54 | const HookType HookType_MAX = CustomKeyCheck; 55 | const int HookType_ARRAYSIZE = HookType_MAX + 1; 56 | 57 | const ::google::protobuf::EnumDescriptor* HookType_descriptor(); 58 | inline const ::std::string& HookType_Name(HookType value) { 59 | return ::google::protobuf::internal::NameOfEnum( 60 | HookType_descriptor(), value); 61 | } 62 | inline bool HookType_Parse( 63 | const ::std::string& name, HookType* value) { 64 | return ::google::protobuf::internal::ParseNamedEnum( 65 | HookType_descriptor(), name, value); 66 | } 67 | // =================================================================== 68 | 69 | class StringSlice : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:coprocess.StringSlice) */ { 70 | public: 71 | StringSlice(); 72 | virtual ~StringSlice(); 73 | 74 | StringSlice(const StringSlice& from); 75 | 76 | inline StringSlice& operator=(const StringSlice& from) { 77 | CopyFrom(from); 78 | return *this; 79 | } 80 | 81 | static const ::google::protobuf::Descriptor* descriptor(); 82 | static const StringSlice& default_instance(); 83 | 84 | static const StringSlice* internal_default_instance(); 85 | 86 | void Swap(StringSlice* other); 87 | 88 | // implements Message ---------------------------------------------- 89 | 90 | inline StringSlice* New() const { return New(NULL); } 91 | 92 | StringSlice* New(::google::protobuf::Arena* arena) const; 93 | void CopyFrom(const ::google::protobuf::Message& from); 94 | void MergeFrom(const ::google::protobuf::Message& from); 95 | void CopyFrom(const StringSlice& from); 96 | void MergeFrom(const StringSlice& from); 97 | void Clear(); 98 | bool IsInitialized() const; 99 | 100 | size_t ByteSizeLong() const; 101 | bool MergePartialFromCodedStream( 102 | ::google::protobuf::io::CodedInputStream* input); 103 | void SerializeWithCachedSizes( 104 | ::google::protobuf::io::CodedOutputStream* output) const; 105 | ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( 106 | bool deterministic, ::google::protobuf::uint8* output) const; 107 | ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { 108 | return InternalSerializeWithCachedSizesToArray(false, output); 109 | } 110 | int GetCachedSize() const { return _cached_size_; } 111 | private: 112 | void SharedCtor(); 113 | void SharedDtor(); 114 | void SetCachedSize(int size) const; 115 | void InternalSwap(StringSlice* other); 116 | void UnsafeMergeFrom(const StringSlice& from); 117 | private: 118 | inline ::google::protobuf::Arena* GetArenaNoVirtual() const { 119 | return _internal_metadata_.arena(); 120 | } 121 | inline void* MaybeArenaPtr() const { 122 | return _internal_metadata_.raw_arena_ptr(); 123 | } 124 | public: 125 | 126 | ::google::protobuf::Metadata GetMetadata() const; 127 | 128 | // nested types ---------------------------------------------------- 129 | 130 | // accessors ------------------------------------------------------- 131 | 132 | // repeated string items = 1; 133 | int items_size() const; 134 | void clear_items(); 135 | static const int kItemsFieldNumber = 1; 136 | const ::std::string& items(int index) const; 137 | ::std::string* mutable_items(int index); 138 | void set_items(int index, const ::std::string& value); 139 | void set_items(int index, const char* value); 140 | void set_items(int index, const char* value, size_t size); 141 | ::std::string* add_items(); 142 | void add_items(const ::std::string& value); 143 | void add_items(const char* value); 144 | void add_items(const char* value, size_t size); 145 | const ::google::protobuf::RepeatedPtrField< ::std::string>& items() const; 146 | ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_items(); 147 | 148 | // @@protoc_insertion_point(class_scope:coprocess.StringSlice) 149 | private: 150 | 151 | ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; 152 | ::google::protobuf::RepeatedPtrField< ::std::string> items_; 153 | mutable int _cached_size_; 154 | friend void protobuf_InitDefaults_coprocess_5fcommon_2eproto_impl(); 155 | friend void protobuf_AddDesc_coprocess_5fcommon_2eproto_impl(); 156 | friend void protobuf_AssignDesc_coprocess_5fcommon_2eproto(); 157 | friend void protobuf_ShutdownFile_coprocess_5fcommon_2eproto(); 158 | 159 | void InitAsDefaultInstance(); 160 | }; 161 | extern ::google::protobuf::internal::ExplicitlyConstructed StringSlice_default_instance_; 162 | 163 | // =================================================================== 164 | 165 | 166 | // =================================================================== 167 | 168 | #if !PROTOBUF_INLINE_NOT_IN_HEADERS 169 | // StringSlice 170 | 171 | // repeated string items = 1; 172 | inline int StringSlice::items_size() const { 173 | return items_.size(); 174 | } 175 | inline void StringSlice::clear_items() { 176 | items_.Clear(); 177 | } 178 | inline const ::std::string& StringSlice::items(int index) const { 179 | // @@protoc_insertion_point(field_get:coprocess.StringSlice.items) 180 | return items_.Get(index); 181 | } 182 | inline ::std::string* StringSlice::mutable_items(int index) { 183 | // @@protoc_insertion_point(field_mutable:coprocess.StringSlice.items) 184 | return items_.Mutable(index); 185 | } 186 | inline void StringSlice::set_items(int index, const ::std::string& value) { 187 | // @@protoc_insertion_point(field_set:coprocess.StringSlice.items) 188 | items_.Mutable(index)->assign(value); 189 | } 190 | inline void StringSlice::set_items(int index, const char* value) { 191 | items_.Mutable(index)->assign(value); 192 | // @@protoc_insertion_point(field_set_char:coprocess.StringSlice.items) 193 | } 194 | inline void StringSlice::set_items(int index, const char* value, size_t size) { 195 | items_.Mutable(index)->assign( 196 | reinterpret_cast(value), size); 197 | // @@protoc_insertion_point(field_set_pointer:coprocess.StringSlice.items) 198 | } 199 | inline ::std::string* StringSlice::add_items() { 200 | // @@protoc_insertion_point(field_add_mutable:coprocess.StringSlice.items) 201 | return items_.Add(); 202 | } 203 | inline void StringSlice::add_items(const ::std::string& value) { 204 | items_.Add()->assign(value); 205 | // @@protoc_insertion_point(field_add:coprocess.StringSlice.items) 206 | } 207 | inline void StringSlice::add_items(const char* value) { 208 | items_.Add()->assign(value); 209 | // @@protoc_insertion_point(field_add_char:coprocess.StringSlice.items) 210 | } 211 | inline void StringSlice::add_items(const char* value, size_t size) { 212 | items_.Add()->assign(reinterpret_cast(value), size); 213 | // @@protoc_insertion_point(field_add_pointer:coprocess.StringSlice.items) 214 | } 215 | inline const ::google::protobuf::RepeatedPtrField< ::std::string>& 216 | StringSlice::items() const { 217 | // @@protoc_insertion_point(field_list:coprocess.StringSlice.items) 218 | return items_; 219 | } 220 | inline ::google::protobuf::RepeatedPtrField< ::std::string>* 221 | StringSlice::mutable_items() { 222 | // @@protoc_insertion_point(field_mutable_list:coprocess.StringSlice.items) 223 | return &items_; 224 | } 225 | 226 | inline const StringSlice* StringSlice::internal_default_instance() { 227 | return &StringSlice_default_instance_.get(); 228 | } 229 | #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS 230 | 231 | // @@protoc_insertion_point(namespace_scope) 232 | 233 | } // namespace coprocess 234 | 235 | #ifndef SWIG 236 | namespace google { 237 | namespace protobuf { 238 | 239 | template <> struct is_proto_enum< ::coprocess::HookType> : ::google::protobuf::internal::true_type {}; 240 | template <> 241 | inline const EnumDescriptor* GetEnumDescriptor< ::coprocess::HookType>() { 242 | return ::coprocess::HookType_descriptor(); 243 | } 244 | 245 | } // namespace protobuf 246 | } // namespace google 247 | #endif // SWIG 248 | 249 | // @@protoc_insertion_point(global_scope) 250 | 251 | #endif // PROTOBUF_coprocess_5fcommon_2eproto__INCLUDED 252 | -------------------------------------------------------------------------------- /bindings/cpp/coprocess_object.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: coprocess_object.proto 3 | 4 | #ifndef PROTOBUF_coprocess_5fobject_2eproto__INCLUDED 5 | #define PROTOBUF_coprocess_5fobject_2eproto__INCLUDED 6 | 7 | #include 8 | 9 | #include 10 | 11 | #if GOOGLE_PROTOBUF_VERSION < 3001000 12 | #error This file was generated by a newer version of protoc which is 13 | #error incompatible with your Protocol Buffer headers. Please update 14 | #error your headers. 15 | #endif 16 | #if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 17 | #error This file was generated by an older version of protoc which is 18 | #error incompatible with your Protocol Buffer headers. Please 19 | #error regenerate this file with a newer version of protoc. 20 | #endif 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include "coprocess_mini_request_object.pb.h" 33 | #include "coprocess_session_state.pb.h" 34 | #include "coprocess_common.pb.h" 35 | // @@protoc_insertion_point(includes) 36 | 37 | namespace coprocess { 38 | 39 | // Internal implementation detail -- do not call these. 40 | void protobuf_AddDesc_coprocess_5fobject_2eproto(); 41 | void protobuf_InitDefaults_coprocess_5fobject_2eproto(); 42 | void protobuf_AssignDesc_coprocess_5fobject_2eproto(); 43 | void protobuf_ShutdownFile_coprocess_5fobject_2eproto(); 44 | 45 | class Event; 46 | class EventReply; 47 | class Object; 48 | 49 | // =================================================================== 50 | 51 | class Object : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:coprocess.Object) */ { 52 | public: 53 | Object(); 54 | virtual ~Object(); 55 | 56 | Object(const Object& from); 57 | 58 | inline Object& operator=(const Object& from) { 59 | CopyFrom(from); 60 | return *this; 61 | } 62 | 63 | static const ::google::protobuf::Descriptor* descriptor(); 64 | static const Object& default_instance(); 65 | 66 | static const Object* internal_default_instance(); 67 | 68 | void Swap(Object* other); 69 | 70 | // implements Message ---------------------------------------------- 71 | 72 | inline Object* New() const { return New(NULL); } 73 | 74 | Object* New(::google::protobuf::Arena* arena) const; 75 | void CopyFrom(const ::google::protobuf::Message& from); 76 | void MergeFrom(const ::google::protobuf::Message& from); 77 | void CopyFrom(const Object& from); 78 | void MergeFrom(const Object& from); 79 | void Clear(); 80 | bool IsInitialized() const; 81 | 82 | size_t ByteSizeLong() const; 83 | bool MergePartialFromCodedStream( 84 | ::google::protobuf::io::CodedInputStream* input); 85 | void SerializeWithCachedSizes( 86 | ::google::protobuf::io::CodedOutputStream* output) const; 87 | ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( 88 | bool deterministic, ::google::protobuf::uint8* output) const; 89 | ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { 90 | return InternalSerializeWithCachedSizesToArray(false, output); 91 | } 92 | int GetCachedSize() const { return _cached_size_; } 93 | private: 94 | void SharedCtor(); 95 | void SharedDtor(); 96 | void SetCachedSize(int size) const; 97 | void InternalSwap(Object* other); 98 | void UnsafeMergeFrom(const Object& from); 99 | private: 100 | inline ::google::protobuf::Arena* GetArenaNoVirtual() const { 101 | return _internal_metadata_.arena(); 102 | } 103 | inline void* MaybeArenaPtr() const { 104 | return _internal_metadata_.raw_arena_ptr(); 105 | } 106 | public: 107 | 108 | ::google::protobuf::Metadata GetMetadata() const; 109 | 110 | // nested types ---------------------------------------------------- 111 | 112 | 113 | // accessors ------------------------------------------------------- 114 | 115 | // optional .coprocess.HookType hook_type = 1; 116 | void clear_hook_type(); 117 | static const int kHookTypeFieldNumber = 1; 118 | ::coprocess::HookType hook_type() const; 119 | void set_hook_type(::coprocess::HookType value); 120 | 121 | // optional string hook_name = 2; 122 | void clear_hook_name(); 123 | static const int kHookNameFieldNumber = 2; 124 | const ::std::string& hook_name() const; 125 | void set_hook_name(const ::std::string& value); 126 | void set_hook_name(const char* value); 127 | void set_hook_name(const char* value, size_t size); 128 | ::std::string* mutable_hook_name(); 129 | ::std::string* release_hook_name(); 130 | void set_allocated_hook_name(::std::string* hook_name); 131 | 132 | // optional .coprocess.MiniRequestObject request = 3; 133 | bool has_request() const; 134 | void clear_request(); 135 | static const int kRequestFieldNumber = 3; 136 | const ::coprocess::MiniRequestObject& request() const; 137 | ::coprocess::MiniRequestObject* mutable_request(); 138 | ::coprocess::MiniRequestObject* release_request(); 139 | void set_allocated_request(::coprocess::MiniRequestObject* request); 140 | 141 | // optional .coprocess.SessionState session = 4; 142 | bool has_session() const; 143 | void clear_session(); 144 | static const int kSessionFieldNumber = 4; 145 | const ::coprocess::SessionState& session() const; 146 | ::coprocess::SessionState* mutable_session(); 147 | ::coprocess::SessionState* release_session(); 148 | void set_allocated_session(::coprocess::SessionState* session); 149 | 150 | // map metadata = 5; 151 | int metadata_size() const; 152 | void clear_metadata(); 153 | static const int kMetadataFieldNumber = 5; 154 | const ::google::protobuf::Map< ::std::string, ::std::string >& 155 | metadata() const; 156 | ::google::protobuf::Map< ::std::string, ::std::string >* 157 | mutable_metadata(); 158 | 159 | // map spec = 6; 160 | int spec_size() const; 161 | void clear_spec(); 162 | static const int kSpecFieldNumber = 6; 163 | const ::google::protobuf::Map< ::std::string, ::std::string >& 164 | spec() const; 165 | ::google::protobuf::Map< ::std::string, ::std::string >* 166 | mutable_spec(); 167 | 168 | // @@protoc_insertion_point(class_scope:coprocess.Object) 169 | private: 170 | 171 | ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; 172 | typedef ::google::protobuf::internal::MapEntryLite< 173 | ::std::string, ::std::string, 174 | ::google::protobuf::internal::WireFormatLite::TYPE_STRING, 175 | ::google::protobuf::internal::WireFormatLite::TYPE_STRING, 176 | 0 > 177 | Object_MetadataEntry; 178 | ::google::protobuf::internal::MapField< 179 | ::std::string, ::std::string, 180 | ::google::protobuf::internal::WireFormatLite::TYPE_STRING, 181 | ::google::protobuf::internal::WireFormatLite::TYPE_STRING, 182 | 0 > metadata_; 183 | typedef ::google::protobuf::internal::MapEntryLite< 184 | ::std::string, ::std::string, 185 | ::google::protobuf::internal::WireFormatLite::TYPE_STRING, 186 | ::google::protobuf::internal::WireFormatLite::TYPE_STRING, 187 | 0 > 188 | Object_SpecEntry; 189 | ::google::protobuf::internal::MapField< 190 | ::std::string, ::std::string, 191 | ::google::protobuf::internal::WireFormatLite::TYPE_STRING, 192 | ::google::protobuf::internal::WireFormatLite::TYPE_STRING, 193 | 0 > spec_; 194 | ::google::protobuf::internal::ArenaStringPtr hook_name_; 195 | ::coprocess::MiniRequestObject* request_; 196 | ::coprocess::SessionState* session_; 197 | int hook_type_; 198 | mutable int _cached_size_; 199 | friend void protobuf_InitDefaults_coprocess_5fobject_2eproto_impl(); 200 | friend void protobuf_AddDesc_coprocess_5fobject_2eproto_impl(); 201 | friend void protobuf_AssignDesc_coprocess_5fobject_2eproto(); 202 | friend void protobuf_ShutdownFile_coprocess_5fobject_2eproto(); 203 | 204 | void InitAsDefaultInstance(); 205 | }; 206 | extern ::google::protobuf::internal::ExplicitlyConstructed Object_default_instance_; 207 | 208 | // ------------------------------------------------------------------- 209 | 210 | class Event : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:coprocess.Event) */ { 211 | public: 212 | Event(); 213 | virtual ~Event(); 214 | 215 | Event(const Event& from); 216 | 217 | inline Event& operator=(const Event& from) { 218 | CopyFrom(from); 219 | return *this; 220 | } 221 | 222 | static const ::google::protobuf::Descriptor* descriptor(); 223 | static const Event& default_instance(); 224 | 225 | static const Event* internal_default_instance(); 226 | 227 | void Swap(Event* other); 228 | 229 | // implements Message ---------------------------------------------- 230 | 231 | inline Event* New() const { return New(NULL); } 232 | 233 | Event* New(::google::protobuf::Arena* arena) const; 234 | void CopyFrom(const ::google::protobuf::Message& from); 235 | void MergeFrom(const ::google::protobuf::Message& from); 236 | void CopyFrom(const Event& from); 237 | void MergeFrom(const Event& from); 238 | void Clear(); 239 | bool IsInitialized() const; 240 | 241 | size_t ByteSizeLong() const; 242 | bool MergePartialFromCodedStream( 243 | ::google::protobuf::io::CodedInputStream* input); 244 | void SerializeWithCachedSizes( 245 | ::google::protobuf::io::CodedOutputStream* output) const; 246 | ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( 247 | bool deterministic, ::google::protobuf::uint8* output) const; 248 | ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { 249 | return InternalSerializeWithCachedSizesToArray(false, output); 250 | } 251 | int GetCachedSize() const { return _cached_size_; } 252 | private: 253 | void SharedCtor(); 254 | void SharedDtor(); 255 | void SetCachedSize(int size) const; 256 | void InternalSwap(Event* other); 257 | void UnsafeMergeFrom(const Event& from); 258 | private: 259 | inline ::google::protobuf::Arena* GetArenaNoVirtual() const { 260 | return _internal_metadata_.arena(); 261 | } 262 | inline void* MaybeArenaPtr() const { 263 | return _internal_metadata_.raw_arena_ptr(); 264 | } 265 | public: 266 | 267 | ::google::protobuf::Metadata GetMetadata() const; 268 | 269 | // nested types ---------------------------------------------------- 270 | 271 | // accessors ------------------------------------------------------- 272 | 273 | // optional string payload = 1; 274 | void clear_payload(); 275 | static const int kPayloadFieldNumber = 1; 276 | const ::std::string& payload() const; 277 | void set_payload(const ::std::string& value); 278 | void set_payload(const char* value); 279 | void set_payload(const char* value, size_t size); 280 | ::std::string* mutable_payload(); 281 | ::std::string* release_payload(); 282 | void set_allocated_payload(::std::string* payload); 283 | 284 | // @@protoc_insertion_point(class_scope:coprocess.Event) 285 | private: 286 | 287 | ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; 288 | ::google::protobuf::internal::ArenaStringPtr payload_; 289 | mutable int _cached_size_; 290 | friend void protobuf_InitDefaults_coprocess_5fobject_2eproto_impl(); 291 | friend void protobuf_AddDesc_coprocess_5fobject_2eproto_impl(); 292 | friend void protobuf_AssignDesc_coprocess_5fobject_2eproto(); 293 | friend void protobuf_ShutdownFile_coprocess_5fobject_2eproto(); 294 | 295 | void InitAsDefaultInstance(); 296 | }; 297 | extern ::google::protobuf::internal::ExplicitlyConstructed Event_default_instance_; 298 | 299 | // ------------------------------------------------------------------- 300 | 301 | class EventReply : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:coprocess.EventReply) */ { 302 | public: 303 | EventReply(); 304 | virtual ~EventReply(); 305 | 306 | EventReply(const EventReply& from); 307 | 308 | inline EventReply& operator=(const EventReply& from) { 309 | CopyFrom(from); 310 | return *this; 311 | } 312 | 313 | static const ::google::protobuf::Descriptor* descriptor(); 314 | static const EventReply& default_instance(); 315 | 316 | static const EventReply* internal_default_instance(); 317 | 318 | void Swap(EventReply* other); 319 | 320 | // implements Message ---------------------------------------------- 321 | 322 | inline EventReply* New() const { return New(NULL); } 323 | 324 | EventReply* New(::google::protobuf::Arena* arena) const; 325 | void CopyFrom(const ::google::protobuf::Message& from); 326 | void MergeFrom(const ::google::protobuf::Message& from); 327 | void CopyFrom(const EventReply& from); 328 | void MergeFrom(const EventReply& from); 329 | void Clear(); 330 | bool IsInitialized() const; 331 | 332 | size_t ByteSizeLong() const; 333 | bool MergePartialFromCodedStream( 334 | ::google::protobuf::io::CodedInputStream* input); 335 | void SerializeWithCachedSizes( 336 | ::google::protobuf::io::CodedOutputStream* output) const; 337 | ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( 338 | bool deterministic, ::google::protobuf::uint8* output) const; 339 | ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { 340 | return InternalSerializeWithCachedSizesToArray(false, output); 341 | } 342 | int GetCachedSize() const { return _cached_size_; } 343 | private: 344 | void SharedCtor(); 345 | void SharedDtor(); 346 | void SetCachedSize(int size) const; 347 | void InternalSwap(EventReply* other); 348 | void UnsafeMergeFrom(const EventReply& from); 349 | private: 350 | inline ::google::protobuf::Arena* GetArenaNoVirtual() const { 351 | return _internal_metadata_.arena(); 352 | } 353 | inline void* MaybeArenaPtr() const { 354 | return _internal_metadata_.raw_arena_ptr(); 355 | } 356 | public: 357 | 358 | ::google::protobuf::Metadata GetMetadata() const; 359 | 360 | // nested types ---------------------------------------------------- 361 | 362 | // accessors ------------------------------------------------------- 363 | 364 | // @@protoc_insertion_point(class_scope:coprocess.EventReply) 365 | private: 366 | 367 | ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; 368 | mutable int _cached_size_; 369 | friend void protobuf_InitDefaults_coprocess_5fobject_2eproto_impl(); 370 | friend void protobuf_AddDesc_coprocess_5fobject_2eproto_impl(); 371 | friend void protobuf_AssignDesc_coprocess_5fobject_2eproto(); 372 | friend void protobuf_ShutdownFile_coprocess_5fobject_2eproto(); 373 | 374 | void InitAsDefaultInstance(); 375 | }; 376 | extern ::google::protobuf::internal::ExplicitlyConstructed EventReply_default_instance_; 377 | 378 | // =================================================================== 379 | 380 | 381 | // =================================================================== 382 | 383 | #if !PROTOBUF_INLINE_NOT_IN_HEADERS 384 | // Object 385 | 386 | // optional .coprocess.HookType hook_type = 1; 387 | inline void Object::clear_hook_type() { 388 | hook_type_ = 0; 389 | } 390 | inline ::coprocess::HookType Object::hook_type() const { 391 | // @@protoc_insertion_point(field_get:coprocess.Object.hook_type) 392 | return static_cast< ::coprocess::HookType >(hook_type_); 393 | } 394 | inline void Object::set_hook_type(::coprocess::HookType value) { 395 | 396 | hook_type_ = value; 397 | // @@protoc_insertion_point(field_set:coprocess.Object.hook_type) 398 | } 399 | 400 | // optional string hook_name = 2; 401 | inline void Object::clear_hook_name() { 402 | hook_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 403 | } 404 | inline const ::std::string& Object::hook_name() const { 405 | // @@protoc_insertion_point(field_get:coprocess.Object.hook_name) 406 | return hook_name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 407 | } 408 | inline void Object::set_hook_name(const ::std::string& value) { 409 | 410 | hook_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 411 | // @@protoc_insertion_point(field_set:coprocess.Object.hook_name) 412 | } 413 | inline void Object::set_hook_name(const char* value) { 414 | 415 | hook_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 416 | // @@protoc_insertion_point(field_set_char:coprocess.Object.hook_name) 417 | } 418 | inline void Object::set_hook_name(const char* value, size_t size) { 419 | 420 | hook_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 421 | ::std::string(reinterpret_cast(value), size)); 422 | // @@protoc_insertion_point(field_set_pointer:coprocess.Object.hook_name) 423 | } 424 | inline ::std::string* Object::mutable_hook_name() { 425 | 426 | // @@protoc_insertion_point(field_mutable:coprocess.Object.hook_name) 427 | return hook_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 428 | } 429 | inline ::std::string* Object::release_hook_name() { 430 | // @@protoc_insertion_point(field_release:coprocess.Object.hook_name) 431 | 432 | return hook_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 433 | } 434 | inline void Object::set_allocated_hook_name(::std::string* hook_name) { 435 | if (hook_name != NULL) { 436 | 437 | } else { 438 | 439 | } 440 | hook_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), hook_name); 441 | // @@protoc_insertion_point(field_set_allocated:coprocess.Object.hook_name) 442 | } 443 | 444 | // optional .coprocess.MiniRequestObject request = 3; 445 | inline bool Object::has_request() const { 446 | return this != internal_default_instance() && request_ != NULL; 447 | } 448 | inline void Object::clear_request() { 449 | if (GetArenaNoVirtual() == NULL && request_ != NULL) delete request_; 450 | request_ = NULL; 451 | } 452 | inline const ::coprocess::MiniRequestObject& Object::request() const { 453 | // @@protoc_insertion_point(field_get:coprocess.Object.request) 454 | return request_ != NULL ? *request_ 455 | : *::coprocess::MiniRequestObject::internal_default_instance(); 456 | } 457 | inline ::coprocess::MiniRequestObject* Object::mutable_request() { 458 | 459 | if (request_ == NULL) { 460 | request_ = new ::coprocess::MiniRequestObject; 461 | } 462 | // @@protoc_insertion_point(field_mutable:coprocess.Object.request) 463 | return request_; 464 | } 465 | inline ::coprocess::MiniRequestObject* Object::release_request() { 466 | // @@protoc_insertion_point(field_release:coprocess.Object.request) 467 | 468 | ::coprocess::MiniRequestObject* temp = request_; 469 | request_ = NULL; 470 | return temp; 471 | } 472 | inline void Object::set_allocated_request(::coprocess::MiniRequestObject* request) { 473 | delete request_; 474 | request_ = request; 475 | if (request) { 476 | 477 | } else { 478 | 479 | } 480 | // @@protoc_insertion_point(field_set_allocated:coprocess.Object.request) 481 | } 482 | 483 | // optional .coprocess.SessionState session = 4; 484 | inline bool Object::has_session() const { 485 | return this != internal_default_instance() && session_ != NULL; 486 | } 487 | inline void Object::clear_session() { 488 | if (GetArenaNoVirtual() == NULL && session_ != NULL) delete session_; 489 | session_ = NULL; 490 | } 491 | inline const ::coprocess::SessionState& Object::session() const { 492 | // @@protoc_insertion_point(field_get:coprocess.Object.session) 493 | return session_ != NULL ? *session_ 494 | : *::coprocess::SessionState::internal_default_instance(); 495 | } 496 | inline ::coprocess::SessionState* Object::mutable_session() { 497 | 498 | if (session_ == NULL) { 499 | session_ = new ::coprocess::SessionState; 500 | } 501 | // @@protoc_insertion_point(field_mutable:coprocess.Object.session) 502 | return session_; 503 | } 504 | inline ::coprocess::SessionState* Object::release_session() { 505 | // @@protoc_insertion_point(field_release:coprocess.Object.session) 506 | 507 | ::coprocess::SessionState* temp = session_; 508 | session_ = NULL; 509 | return temp; 510 | } 511 | inline void Object::set_allocated_session(::coprocess::SessionState* session) { 512 | delete session_; 513 | session_ = session; 514 | if (session) { 515 | 516 | } else { 517 | 518 | } 519 | // @@protoc_insertion_point(field_set_allocated:coprocess.Object.session) 520 | } 521 | 522 | // map metadata = 5; 523 | inline int Object::metadata_size() const { 524 | return metadata_.size(); 525 | } 526 | inline void Object::clear_metadata() { 527 | metadata_.Clear(); 528 | } 529 | inline const ::google::protobuf::Map< ::std::string, ::std::string >& 530 | Object::metadata() const { 531 | // @@protoc_insertion_point(field_map:coprocess.Object.metadata) 532 | return metadata_.GetMap(); 533 | } 534 | inline ::google::protobuf::Map< ::std::string, ::std::string >* 535 | Object::mutable_metadata() { 536 | // @@protoc_insertion_point(field_mutable_map:coprocess.Object.metadata) 537 | return metadata_.MutableMap(); 538 | } 539 | 540 | // map spec = 6; 541 | inline int Object::spec_size() const { 542 | return spec_.size(); 543 | } 544 | inline void Object::clear_spec() { 545 | spec_.Clear(); 546 | } 547 | inline const ::google::protobuf::Map< ::std::string, ::std::string >& 548 | Object::spec() const { 549 | // @@protoc_insertion_point(field_map:coprocess.Object.spec) 550 | return spec_.GetMap(); 551 | } 552 | inline ::google::protobuf::Map< ::std::string, ::std::string >* 553 | Object::mutable_spec() { 554 | // @@protoc_insertion_point(field_mutable_map:coprocess.Object.spec) 555 | return spec_.MutableMap(); 556 | } 557 | 558 | inline const Object* Object::internal_default_instance() { 559 | return &Object_default_instance_.get(); 560 | } 561 | // ------------------------------------------------------------------- 562 | 563 | // Event 564 | 565 | // optional string payload = 1; 566 | inline void Event::clear_payload() { 567 | payload_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 568 | } 569 | inline const ::std::string& Event::payload() const { 570 | // @@protoc_insertion_point(field_get:coprocess.Event.payload) 571 | return payload_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 572 | } 573 | inline void Event::set_payload(const ::std::string& value) { 574 | 575 | payload_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 576 | // @@protoc_insertion_point(field_set:coprocess.Event.payload) 577 | } 578 | inline void Event::set_payload(const char* value) { 579 | 580 | payload_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 581 | // @@protoc_insertion_point(field_set_char:coprocess.Event.payload) 582 | } 583 | inline void Event::set_payload(const char* value, size_t size) { 584 | 585 | payload_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 586 | ::std::string(reinterpret_cast(value), size)); 587 | // @@protoc_insertion_point(field_set_pointer:coprocess.Event.payload) 588 | } 589 | inline ::std::string* Event::mutable_payload() { 590 | 591 | // @@protoc_insertion_point(field_mutable:coprocess.Event.payload) 592 | return payload_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 593 | } 594 | inline ::std::string* Event::release_payload() { 595 | // @@protoc_insertion_point(field_release:coprocess.Event.payload) 596 | 597 | return payload_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 598 | } 599 | inline void Event::set_allocated_payload(::std::string* payload) { 600 | if (payload != NULL) { 601 | 602 | } else { 603 | 604 | } 605 | payload_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), payload); 606 | // @@protoc_insertion_point(field_set_allocated:coprocess.Event.payload) 607 | } 608 | 609 | inline const Event* Event::internal_default_instance() { 610 | return &Event_default_instance_.get(); 611 | } 612 | // ------------------------------------------------------------------- 613 | 614 | // EventReply 615 | 616 | inline const EventReply* EventReply::internal_default_instance() { 617 | return &EventReply_default_instance_.get(); 618 | } 619 | #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS 620 | // ------------------------------------------------------------------- 621 | 622 | // ------------------------------------------------------------------- 623 | 624 | 625 | // @@protoc_insertion_point(namespace_scope) 626 | 627 | } // namespace coprocess 628 | 629 | // @@protoc_insertion_point(global_scope) 630 | 631 | #endif // PROTOBUF_coprocess_5fobject_2eproto__INCLUDED 632 | -------------------------------------------------------------------------------- /bindings/cpp/coprocess_return_overrides.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: coprocess_return_overrides.proto 3 | 4 | #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION 5 | #include "coprocess_return_overrides.pb.h" 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | // @@protoc_insertion_point(includes) 19 | 20 | namespace coprocess { 21 | 22 | namespace { 23 | 24 | const ::google::protobuf::Descriptor* ReturnOverrides_descriptor_ = NULL; 25 | const ::google::protobuf::internal::GeneratedMessageReflection* 26 | ReturnOverrides_reflection_ = NULL; 27 | 28 | } // namespace 29 | 30 | 31 | void protobuf_AssignDesc_coprocess_5freturn_5foverrides_2eproto() GOOGLE_ATTRIBUTE_COLD; 32 | void protobuf_AssignDesc_coprocess_5freturn_5foverrides_2eproto() { 33 | protobuf_AddDesc_coprocess_5freturn_5foverrides_2eproto(); 34 | const ::google::protobuf::FileDescriptor* file = 35 | ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( 36 | "coprocess_return_overrides.proto"); 37 | GOOGLE_CHECK(file != NULL); 38 | ReturnOverrides_descriptor_ = file->message_type(0); 39 | static const int ReturnOverrides_offsets_[2] = { 40 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReturnOverrides, response_code_), 41 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReturnOverrides, response_error_), 42 | }; 43 | ReturnOverrides_reflection_ = 44 | ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( 45 | ReturnOverrides_descriptor_, 46 | ReturnOverrides::internal_default_instance(), 47 | ReturnOverrides_offsets_, 48 | -1, 49 | -1, 50 | -1, 51 | sizeof(ReturnOverrides), 52 | GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReturnOverrides, _internal_metadata_)); 53 | } 54 | 55 | namespace { 56 | 57 | GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); 58 | void protobuf_AssignDescriptorsOnce() { 59 | ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, 60 | &protobuf_AssignDesc_coprocess_5freturn_5foverrides_2eproto); 61 | } 62 | 63 | void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD; 64 | void protobuf_RegisterTypes(const ::std::string&) { 65 | protobuf_AssignDescriptorsOnce(); 66 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( 67 | ReturnOverrides_descriptor_, ReturnOverrides::internal_default_instance()); 68 | } 69 | 70 | } // namespace 71 | 72 | void protobuf_ShutdownFile_coprocess_5freturn_5foverrides_2eproto() { 73 | ReturnOverrides_default_instance_.Shutdown(); 74 | delete ReturnOverrides_reflection_; 75 | } 76 | 77 | void protobuf_InitDefaults_coprocess_5freturn_5foverrides_2eproto_impl() { 78 | GOOGLE_PROTOBUF_VERIFY_VERSION; 79 | 80 | ::google::protobuf::internal::GetEmptyString(); 81 | ReturnOverrides_default_instance_.DefaultConstruct(); 82 | ReturnOverrides_default_instance_.get_mutable()->InitAsDefaultInstance(); 83 | } 84 | 85 | GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_InitDefaults_coprocess_5freturn_5foverrides_2eproto_once_); 86 | void protobuf_InitDefaults_coprocess_5freturn_5foverrides_2eproto() { 87 | ::google::protobuf::GoogleOnceInit(&protobuf_InitDefaults_coprocess_5freturn_5foverrides_2eproto_once_, 88 | &protobuf_InitDefaults_coprocess_5freturn_5foverrides_2eproto_impl); 89 | } 90 | void protobuf_AddDesc_coprocess_5freturn_5foverrides_2eproto_impl() { 91 | GOOGLE_PROTOBUF_VERIFY_VERSION; 92 | 93 | protobuf_InitDefaults_coprocess_5freturn_5foverrides_2eproto(); 94 | ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( 95 | "\n coprocess_return_overrides.proto\022\tcopr" 96 | "ocess\"@\n\017ReturnOverrides\022\025\n\rresponse_cod" 97 | "e\030\001 \001(\005\022\026\n\016response_error\030\002 \001(\tb\006proto3", 119); 98 | ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( 99 | "coprocess_return_overrides.proto", &protobuf_RegisterTypes); 100 | ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_coprocess_5freturn_5foverrides_2eproto); 101 | } 102 | 103 | GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_coprocess_5freturn_5foverrides_2eproto_once_); 104 | void protobuf_AddDesc_coprocess_5freturn_5foverrides_2eproto() { 105 | ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_coprocess_5freturn_5foverrides_2eproto_once_, 106 | &protobuf_AddDesc_coprocess_5freturn_5foverrides_2eproto_impl); 107 | } 108 | // Force AddDescriptors() to be called at static initialization time. 109 | struct StaticDescriptorInitializer_coprocess_5freturn_5foverrides_2eproto { 110 | StaticDescriptorInitializer_coprocess_5freturn_5foverrides_2eproto() { 111 | protobuf_AddDesc_coprocess_5freturn_5foverrides_2eproto(); 112 | } 113 | } static_descriptor_initializer_coprocess_5freturn_5foverrides_2eproto_; 114 | 115 | namespace { 116 | 117 | static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD GOOGLE_ATTRIBUTE_NORETURN; 118 | static void MergeFromFail(int line) { 119 | ::google::protobuf::internal::MergeFromFail(__FILE__, line); 120 | } 121 | 122 | } // namespace 123 | 124 | 125 | // =================================================================== 126 | 127 | #if !defined(_MSC_VER) || _MSC_VER >= 1900 128 | const int ReturnOverrides::kResponseCodeFieldNumber; 129 | const int ReturnOverrides::kResponseErrorFieldNumber; 130 | #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 131 | 132 | ReturnOverrides::ReturnOverrides() 133 | : ::google::protobuf::Message(), _internal_metadata_(NULL) { 134 | if (this != internal_default_instance()) protobuf_InitDefaults_coprocess_5freturn_5foverrides_2eproto(); 135 | SharedCtor(); 136 | // @@protoc_insertion_point(constructor:coprocess.ReturnOverrides) 137 | } 138 | 139 | void ReturnOverrides::InitAsDefaultInstance() { 140 | } 141 | 142 | ReturnOverrides::ReturnOverrides(const ReturnOverrides& from) 143 | : ::google::protobuf::Message(), 144 | _internal_metadata_(NULL) { 145 | SharedCtor(); 146 | UnsafeMergeFrom(from); 147 | // @@protoc_insertion_point(copy_constructor:coprocess.ReturnOverrides) 148 | } 149 | 150 | void ReturnOverrides::SharedCtor() { 151 | response_error_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 152 | response_code_ = 0; 153 | _cached_size_ = 0; 154 | } 155 | 156 | ReturnOverrides::~ReturnOverrides() { 157 | // @@protoc_insertion_point(destructor:coprocess.ReturnOverrides) 158 | SharedDtor(); 159 | } 160 | 161 | void ReturnOverrides::SharedDtor() { 162 | response_error_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 163 | } 164 | 165 | void ReturnOverrides::SetCachedSize(int size) const { 166 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 167 | _cached_size_ = size; 168 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 169 | } 170 | const ::google::protobuf::Descriptor* ReturnOverrides::descriptor() { 171 | protobuf_AssignDescriptorsOnce(); 172 | return ReturnOverrides_descriptor_; 173 | } 174 | 175 | const ReturnOverrides& ReturnOverrides::default_instance() { 176 | protobuf_InitDefaults_coprocess_5freturn_5foverrides_2eproto(); 177 | return *internal_default_instance(); 178 | } 179 | 180 | ::google::protobuf::internal::ExplicitlyConstructed ReturnOverrides_default_instance_; 181 | 182 | ReturnOverrides* ReturnOverrides::New(::google::protobuf::Arena* arena) const { 183 | ReturnOverrides* n = new ReturnOverrides; 184 | if (arena != NULL) { 185 | arena->Own(n); 186 | } 187 | return n; 188 | } 189 | 190 | void ReturnOverrides::Clear() { 191 | // @@protoc_insertion_point(message_clear_start:coprocess.ReturnOverrides) 192 | response_code_ = 0; 193 | response_error_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 194 | } 195 | 196 | bool ReturnOverrides::MergePartialFromCodedStream( 197 | ::google::protobuf::io::CodedInputStream* input) { 198 | #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure 199 | ::google::protobuf::uint32 tag; 200 | // @@protoc_insertion_point(parse_start:coprocess.ReturnOverrides) 201 | for (;;) { 202 | ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); 203 | tag = p.first; 204 | if (!p.second) goto handle_unusual; 205 | switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { 206 | // optional int32 response_code = 1; 207 | case 1: { 208 | if (tag == 8) { 209 | 210 | DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< 211 | ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( 212 | input, &response_code_))); 213 | } else { 214 | goto handle_unusual; 215 | } 216 | if (input->ExpectTag(18)) goto parse_response_error; 217 | break; 218 | } 219 | 220 | // optional string response_error = 2; 221 | case 2: { 222 | if (tag == 18) { 223 | parse_response_error: 224 | DO_(::google::protobuf::internal::WireFormatLite::ReadString( 225 | input, this->mutable_response_error())); 226 | DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 227 | this->response_error().data(), this->response_error().length(), 228 | ::google::protobuf::internal::WireFormatLite::PARSE, 229 | "coprocess.ReturnOverrides.response_error")); 230 | } else { 231 | goto handle_unusual; 232 | } 233 | if (input->ExpectAtEnd()) goto success; 234 | break; 235 | } 236 | 237 | default: { 238 | handle_unusual: 239 | if (tag == 0 || 240 | ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == 241 | ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { 242 | goto success; 243 | } 244 | DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); 245 | break; 246 | } 247 | } 248 | } 249 | success: 250 | // @@protoc_insertion_point(parse_success:coprocess.ReturnOverrides) 251 | return true; 252 | failure: 253 | // @@protoc_insertion_point(parse_failure:coprocess.ReturnOverrides) 254 | return false; 255 | #undef DO_ 256 | } 257 | 258 | void ReturnOverrides::SerializeWithCachedSizes( 259 | ::google::protobuf::io::CodedOutputStream* output) const { 260 | // @@protoc_insertion_point(serialize_start:coprocess.ReturnOverrides) 261 | // optional int32 response_code = 1; 262 | if (this->response_code() != 0) { 263 | ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->response_code(), output); 264 | } 265 | 266 | // optional string response_error = 2; 267 | if (this->response_error().size() > 0) { 268 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 269 | this->response_error().data(), this->response_error().length(), 270 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 271 | "coprocess.ReturnOverrides.response_error"); 272 | ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( 273 | 2, this->response_error(), output); 274 | } 275 | 276 | // @@protoc_insertion_point(serialize_end:coprocess.ReturnOverrides) 277 | } 278 | 279 | ::google::protobuf::uint8* ReturnOverrides::InternalSerializeWithCachedSizesToArray( 280 | bool deterministic, ::google::protobuf::uint8* target) const { 281 | (void)deterministic; // Unused 282 | // @@protoc_insertion_point(serialize_to_array_start:coprocess.ReturnOverrides) 283 | // optional int32 response_code = 1; 284 | if (this->response_code() != 0) { 285 | target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->response_code(), target); 286 | } 287 | 288 | // optional string response_error = 2; 289 | if (this->response_error().size() > 0) { 290 | ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( 291 | this->response_error().data(), this->response_error().length(), 292 | ::google::protobuf::internal::WireFormatLite::SERIALIZE, 293 | "coprocess.ReturnOverrides.response_error"); 294 | target = 295 | ::google::protobuf::internal::WireFormatLite::WriteStringToArray( 296 | 2, this->response_error(), target); 297 | } 298 | 299 | // @@protoc_insertion_point(serialize_to_array_end:coprocess.ReturnOverrides) 300 | return target; 301 | } 302 | 303 | size_t ReturnOverrides::ByteSizeLong() const { 304 | // @@protoc_insertion_point(message_byte_size_start:coprocess.ReturnOverrides) 305 | size_t total_size = 0; 306 | 307 | // optional int32 response_code = 1; 308 | if (this->response_code() != 0) { 309 | total_size += 1 + 310 | ::google::protobuf::internal::WireFormatLite::Int32Size( 311 | this->response_code()); 312 | } 313 | 314 | // optional string response_error = 2; 315 | if (this->response_error().size() > 0) { 316 | total_size += 1 + 317 | ::google::protobuf::internal::WireFormatLite::StringSize( 318 | this->response_error()); 319 | } 320 | 321 | int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); 322 | GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); 323 | _cached_size_ = cached_size; 324 | GOOGLE_SAFE_CONCURRENT_WRITES_END(); 325 | return total_size; 326 | } 327 | 328 | void ReturnOverrides::MergeFrom(const ::google::protobuf::Message& from) { 329 | // @@protoc_insertion_point(generalized_merge_from_start:coprocess.ReturnOverrides) 330 | if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); 331 | const ReturnOverrides* source = 332 | ::google::protobuf::internal::DynamicCastToGenerated( 333 | &from); 334 | if (source == NULL) { 335 | // @@protoc_insertion_point(generalized_merge_from_cast_fail:coprocess.ReturnOverrides) 336 | ::google::protobuf::internal::ReflectionOps::Merge(from, this); 337 | } else { 338 | // @@protoc_insertion_point(generalized_merge_from_cast_success:coprocess.ReturnOverrides) 339 | UnsafeMergeFrom(*source); 340 | } 341 | } 342 | 343 | void ReturnOverrides::MergeFrom(const ReturnOverrides& from) { 344 | // @@protoc_insertion_point(class_specific_merge_from_start:coprocess.ReturnOverrides) 345 | if (GOOGLE_PREDICT_TRUE(&from != this)) { 346 | UnsafeMergeFrom(from); 347 | } else { 348 | MergeFromFail(__LINE__); 349 | } 350 | } 351 | 352 | void ReturnOverrides::UnsafeMergeFrom(const ReturnOverrides& from) { 353 | GOOGLE_DCHECK(&from != this); 354 | if (from.response_code() != 0) { 355 | set_response_code(from.response_code()); 356 | } 357 | if (from.response_error().size() > 0) { 358 | 359 | response_error_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.response_error_); 360 | } 361 | } 362 | 363 | void ReturnOverrides::CopyFrom(const ::google::protobuf::Message& from) { 364 | // @@protoc_insertion_point(generalized_copy_from_start:coprocess.ReturnOverrides) 365 | if (&from == this) return; 366 | Clear(); 367 | MergeFrom(from); 368 | } 369 | 370 | void ReturnOverrides::CopyFrom(const ReturnOverrides& from) { 371 | // @@protoc_insertion_point(class_specific_copy_from_start:coprocess.ReturnOverrides) 372 | if (&from == this) return; 373 | Clear(); 374 | UnsafeMergeFrom(from); 375 | } 376 | 377 | bool ReturnOverrides::IsInitialized() const { 378 | 379 | return true; 380 | } 381 | 382 | void ReturnOverrides::Swap(ReturnOverrides* other) { 383 | if (other == this) return; 384 | InternalSwap(other); 385 | } 386 | void ReturnOverrides::InternalSwap(ReturnOverrides* other) { 387 | std::swap(response_code_, other->response_code_); 388 | response_error_.Swap(&other->response_error_); 389 | _internal_metadata_.Swap(&other->_internal_metadata_); 390 | std::swap(_cached_size_, other->_cached_size_); 391 | } 392 | 393 | ::google::protobuf::Metadata ReturnOverrides::GetMetadata() const { 394 | protobuf_AssignDescriptorsOnce(); 395 | ::google::protobuf::Metadata metadata; 396 | metadata.descriptor = ReturnOverrides_descriptor_; 397 | metadata.reflection = ReturnOverrides_reflection_; 398 | return metadata; 399 | } 400 | 401 | #if PROTOBUF_INLINE_NOT_IN_HEADERS 402 | // ReturnOverrides 403 | 404 | // optional int32 response_code = 1; 405 | void ReturnOverrides::clear_response_code() { 406 | response_code_ = 0; 407 | } 408 | ::google::protobuf::int32 ReturnOverrides::response_code() const { 409 | // @@protoc_insertion_point(field_get:coprocess.ReturnOverrides.response_code) 410 | return response_code_; 411 | } 412 | void ReturnOverrides::set_response_code(::google::protobuf::int32 value) { 413 | 414 | response_code_ = value; 415 | // @@protoc_insertion_point(field_set:coprocess.ReturnOverrides.response_code) 416 | } 417 | 418 | // optional string response_error = 2; 419 | void ReturnOverrides::clear_response_error() { 420 | response_error_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 421 | } 422 | const ::std::string& ReturnOverrides::response_error() const { 423 | // @@protoc_insertion_point(field_get:coprocess.ReturnOverrides.response_error) 424 | return response_error_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 425 | } 426 | void ReturnOverrides::set_response_error(const ::std::string& value) { 427 | 428 | response_error_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 429 | // @@protoc_insertion_point(field_set:coprocess.ReturnOverrides.response_error) 430 | } 431 | void ReturnOverrides::set_response_error(const char* value) { 432 | 433 | response_error_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 434 | // @@protoc_insertion_point(field_set_char:coprocess.ReturnOverrides.response_error) 435 | } 436 | void ReturnOverrides::set_response_error(const char* value, size_t size) { 437 | 438 | response_error_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 439 | ::std::string(reinterpret_cast(value), size)); 440 | // @@protoc_insertion_point(field_set_pointer:coprocess.ReturnOverrides.response_error) 441 | } 442 | ::std::string* ReturnOverrides::mutable_response_error() { 443 | 444 | // @@protoc_insertion_point(field_mutable:coprocess.ReturnOverrides.response_error) 445 | return response_error_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 446 | } 447 | ::std::string* ReturnOverrides::release_response_error() { 448 | // @@protoc_insertion_point(field_release:coprocess.ReturnOverrides.response_error) 449 | 450 | return response_error_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 451 | } 452 | void ReturnOverrides::set_allocated_response_error(::std::string* response_error) { 453 | if (response_error != NULL) { 454 | 455 | } else { 456 | 457 | } 458 | response_error_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), response_error); 459 | // @@protoc_insertion_point(field_set_allocated:coprocess.ReturnOverrides.response_error) 460 | } 461 | 462 | inline const ReturnOverrides* ReturnOverrides::internal_default_instance() { 463 | return &ReturnOverrides_default_instance_.get(); 464 | } 465 | #endif // PROTOBUF_INLINE_NOT_IN_HEADERS 466 | 467 | // @@protoc_insertion_point(namespace_scope) 468 | 469 | } // namespace coprocess 470 | 471 | // @@protoc_insertion_point(global_scope) 472 | -------------------------------------------------------------------------------- /bindings/cpp/coprocess_return_overrides.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: coprocess_return_overrides.proto 3 | 4 | #ifndef PROTOBUF_coprocess_5freturn_5foverrides_2eproto__INCLUDED 5 | #define PROTOBUF_coprocess_5freturn_5foverrides_2eproto__INCLUDED 6 | 7 | #include 8 | 9 | #include 10 | 11 | #if GOOGLE_PROTOBUF_VERSION < 3001000 12 | #error This file was generated by a newer version of protoc which is 13 | #error incompatible with your Protocol Buffer headers. Please update 14 | #error your headers. 15 | #endif 16 | #if 3001000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 17 | #error This file was generated by an older version of protoc which is 18 | #error incompatible with your Protocol Buffer headers. Please 19 | #error regenerate this file with a newer version of protoc. 20 | #endif 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | // @@protoc_insertion_point(includes) 31 | 32 | namespace coprocess { 33 | 34 | // Internal implementation detail -- do not call these. 35 | void protobuf_AddDesc_coprocess_5freturn_5foverrides_2eproto(); 36 | void protobuf_InitDefaults_coprocess_5freturn_5foverrides_2eproto(); 37 | void protobuf_AssignDesc_coprocess_5freturn_5foverrides_2eproto(); 38 | void protobuf_ShutdownFile_coprocess_5freturn_5foverrides_2eproto(); 39 | 40 | class ReturnOverrides; 41 | 42 | // =================================================================== 43 | 44 | class ReturnOverrides : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:coprocess.ReturnOverrides) */ { 45 | public: 46 | ReturnOverrides(); 47 | virtual ~ReturnOverrides(); 48 | 49 | ReturnOverrides(const ReturnOverrides& from); 50 | 51 | inline ReturnOverrides& operator=(const ReturnOverrides& from) { 52 | CopyFrom(from); 53 | return *this; 54 | } 55 | 56 | static const ::google::protobuf::Descriptor* descriptor(); 57 | static const ReturnOverrides& default_instance(); 58 | 59 | static const ReturnOverrides* internal_default_instance(); 60 | 61 | void Swap(ReturnOverrides* other); 62 | 63 | // implements Message ---------------------------------------------- 64 | 65 | inline ReturnOverrides* New() const { return New(NULL); } 66 | 67 | ReturnOverrides* New(::google::protobuf::Arena* arena) const; 68 | void CopyFrom(const ::google::protobuf::Message& from); 69 | void MergeFrom(const ::google::protobuf::Message& from); 70 | void CopyFrom(const ReturnOverrides& from); 71 | void MergeFrom(const ReturnOverrides& from); 72 | void Clear(); 73 | bool IsInitialized() const; 74 | 75 | size_t ByteSizeLong() const; 76 | bool MergePartialFromCodedStream( 77 | ::google::protobuf::io::CodedInputStream* input); 78 | void SerializeWithCachedSizes( 79 | ::google::protobuf::io::CodedOutputStream* output) const; 80 | ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( 81 | bool deterministic, ::google::protobuf::uint8* output) const; 82 | ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const { 83 | return InternalSerializeWithCachedSizesToArray(false, output); 84 | } 85 | int GetCachedSize() const { return _cached_size_; } 86 | private: 87 | void SharedCtor(); 88 | void SharedDtor(); 89 | void SetCachedSize(int size) const; 90 | void InternalSwap(ReturnOverrides* other); 91 | void UnsafeMergeFrom(const ReturnOverrides& from); 92 | private: 93 | inline ::google::protobuf::Arena* GetArenaNoVirtual() const { 94 | return _internal_metadata_.arena(); 95 | } 96 | inline void* MaybeArenaPtr() const { 97 | return _internal_metadata_.raw_arena_ptr(); 98 | } 99 | public: 100 | 101 | ::google::protobuf::Metadata GetMetadata() const; 102 | 103 | // nested types ---------------------------------------------------- 104 | 105 | // accessors ------------------------------------------------------- 106 | 107 | // optional int32 response_code = 1; 108 | void clear_response_code(); 109 | static const int kResponseCodeFieldNumber = 1; 110 | ::google::protobuf::int32 response_code() const; 111 | void set_response_code(::google::protobuf::int32 value); 112 | 113 | // optional string response_error = 2; 114 | void clear_response_error(); 115 | static const int kResponseErrorFieldNumber = 2; 116 | const ::std::string& response_error() const; 117 | void set_response_error(const ::std::string& value); 118 | void set_response_error(const char* value); 119 | void set_response_error(const char* value, size_t size); 120 | ::std::string* mutable_response_error(); 121 | ::std::string* release_response_error(); 122 | void set_allocated_response_error(::std::string* response_error); 123 | 124 | // @@protoc_insertion_point(class_scope:coprocess.ReturnOverrides) 125 | private: 126 | 127 | ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; 128 | ::google::protobuf::internal::ArenaStringPtr response_error_; 129 | ::google::protobuf::int32 response_code_; 130 | mutable int _cached_size_; 131 | friend void protobuf_InitDefaults_coprocess_5freturn_5foverrides_2eproto_impl(); 132 | friend void protobuf_AddDesc_coprocess_5freturn_5foverrides_2eproto_impl(); 133 | friend void protobuf_AssignDesc_coprocess_5freturn_5foverrides_2eproto(); 134 | friend void protobuf_ShutdownFile_coprocess_5freturn_5foverrides_2eproto(); 135 | 136 | void InitAsDefaultInstance(); 137 | }; 138 | extern ::google::protobuf::internal::ExplicitlyConstructed ReturnOverrides_default_instance_; 139 | 140 | // =================================================================== 141 | 142 | 143 | // =================================================================== 144 | 145 | #if !PROTOBUF_INLINE_NOT_IN_HEADERS 146 | // ReturnOverrides 147 | 148 | // optional int32 response_code = 1; 149 | inline void ReturnOverrides::clear_response_code() { 150 | response_code_ = 0; 151 | } 152 | inline ::google::protobuf::int32 ReturnOverrides::response_code() const { 153 | // @@protoc_insertion_point(field_get:coprocess.ReturnOverrides.response_code) 154 | return response_code_; 155 | } 156 | inline void ReturnOverrides::set_response_code(::google::protobuf::int32 value) { 157 | 158 | response_code_ = value; 159 | // @@protoc_insertion_point(field_set:coprocess.ReturnOverrides.response_code) 160 | } 161 | 162 | // optional string response_error = 2; 163 | inline void ReturnOverrides::clear_response_error() { 164 | response_error_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 165 | } 166 | inline const ::std::string& ReturnOverrides::response_error() const { 167 | // @@protoc_insertion_point(field_get:coprocess.ReturnOverrides.response_error) 168 | return response_error_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 169 | } 170 | inline void ReturnOverrides::set_response_error(const ::std::string& value) { 171 | 172 | response_error_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); 173 | // @@protoc_insertion_point(field_set:coprocess.ReturnOverrides.response_error) 174 | } 175 | inline void ReturnOverrides::set_response_error(const char* value) { 176 | 177 | response_error_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); 178 | // @@protoc_insertion_point(field_set_char:coprocess.ReturnOverrides.response_error) 179 | } 180 | inline void ReturnOverrides::set_response_error(const char* value, size_t size) { 181 | 182 | response_error_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), 183 | ::std::string(reinterpret_cast(value), size)); 184 | // @@protoc_insertion_point(field_set_pointer:coprocess.ReturnOverrides.response_error) 185 | } 186 | inline ::std::string* ReturnOverrides::mutable_response_error() { 187 | 188 | // @@protoc_insertion_point(field_mutable:coprocess.ReturnOverrides.response_error) 189 | return response_error_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 190 | } 191 | inline ::std::string* ReturnOverrides::release_response_error() { 192 | // @@protoc_insertion_point(field_release:coprocess.ReturnOverrides.response_error) 193 | 194 | return response_error_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); 195 | } 196 | inline void ReturnOverrides::set_allocated_response_error(::std::string* response_error) { 197 | if (response_error != NULL) { 198 | 199 | } else { 200 | 201 | } 202 | response_error_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), response_error); 203 | // @@protoc_insertion_point(field_set_allocated:coprocess.ReturnOverrides.response_error) 204 | } 205 | 206 | inline const ReturnOverrides* ReturnOverrides::internal_default_instance() { 207 | return &ReturnOverrides_default_instance_.get(); 208 | } 209 | #endif // !PROTOBUF_INLINE_NOT_IN_HEADERS 210 | 211 | // @@protoc_insertion_point(namespace_scope) 212 | 213 | } // namespace coprocess 214 | 215 | // @@protoc_insertion_point(global_scope) 216 | 217 | #endif // PROTOBUF_coprocess_5freturn_5foverrides_2eproto__INCLUDED 218 | -------------------------------------------------------------------------------- /bindings/java/CoprocessReturnOverrides.java: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: coprocess_return_overrides.proto 3 | 4 | package coprocess; 5 | 6 | public final class CoprocessReturnOverrides { 7 | private CoprocessReturnOverrides() {} 8 | public static void registerAllExtensions( 9 | com.google.protobuf.ExtensionRegistryLite registry) { 10 | } 11 | 12 | public static void registerAllExtensions( 13 | com.google.protobuf.ExtensionRegistry registry) { 14 | registerAllExtensions( 15 | (com.google.protobuf.ExtensionRegistryLite) registry); 16 | } 17 | public interface ReturnOverridesOrBuilder extends 18 | // @@protoc_insertion_point(interface_extends:coprocess.ReturnOverrides) 19 | com.google.protobuf.MessageOrBuilder { 20 | 21 | /** 22 | * optional int32 response_code = 1; 23 | */ 24 | int getResponseCode(); 25 | 26 | /** 27 | * optional string response_error = 2; 28 | */ 29 | java.lang.String getResponseError(); 30 | /** 31 | * optional string response_error = 2; 32 | */ 33 | com.google.protobuf.ByteString 34 | getResponseErrorBytes(); 35 | } 36 | /** 37 | * Protobuf type {@code coprocess.ReturnOverrides} 38 | */ 39 | public static final class ReturnOverrides extends 40 | com.google.protobuf.GeneratedMessageV3 implements 41 | // @@protoc_insertion_point(message_implements:coprocess.ReturnOverrides) 42 | ReturnOverridesOrBuilder { 43 | // Use ReturnOverrides.newBuilder() to construct. 44 | private ReturnOverrides(com.google.protobuf.GeneratedMessageV3.Builder builder) { 45 | super(builder); 46 | } 47 | private ReturnOverrides() { 48 | responseCode_ = 0; 49 | responseError_ = ""; 50 | } 51 | 52 | @java.lang.Override 53 | public final com.google.protobuf.UnknownFieldSet 54 | getUnknownFields() { 55 | return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); 56 | } 57 | private ReturnOverrides( 58 | com.google.protobuf.CodedInputStream input, 59 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 60 | throws com.google.protobuf.InvalidProtocolBufferException { 61 | this(); 62 | int mutable_bitField0_ = 0; 63 | try { 64 | boolean done = false; 65 | while (!done) { 66 | int tag = input.readTag(); 67 | switch (tag) { 68 | case 0: 69 | done = true; 70 | break; 71 | default: { 72 | if (!input.skipField(tag)) { 73 | done = true; 74 | } 75 | break; 76 | } 77 | case 8: { 78 | 79 | responseCode_ = input.readInt32(); 80 | break; 81 | } 82 | case 18: { 83 | java.lang.String s = input.readStringRequireUtf8(); 84 | 85 | responseError_ = s; 86 | break; 87 | } 88 | } 89 | } 90 | } catch (com.google.protobuf.InvalidProtocolBufferException e) { 91 | throw e.setUnfinishedMessage(this); 92 | } catch (java.io.IOException e) { 93 | throw new com.google.protobuf.InvalidProtocolBufferException( 94 | e).setUnfinishedMessage(this); 95 | } finally { 96 | makeExtensionsImmutable(); 97 | } 98 | } 99 | public static final com.google.protobuf.Descriptors.Descriptor 100 | getDescriptor() { 101 | return coprocess.CoprocessReturnOverrides.internal_static_coprocess_ReturnOverrides_descriptor; 102 | } 103 | 104 | protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable 105 | internalGetFieldAccessorTable() { 106 | return coprocess.CoprocessReturnOverrides.internal_static_coprocess_ReturnOverrides_fieldAccessorTable 107 | .ensureFieldAccessorsInitialized( 108 | coprocess.CoprocessReturnOverrides.ReturnOverrides.class, coprocess.CoprocessReturnOverrides.ReturnOverrides.Builder.class); 109 | } 110 | 111 | public static final int RESPONSE_CODE_FIELD_NUMBER = 1; 112 | private int responseCode_; 113 | /** 114 | * optional int32 response_code = 1; 115 | */ 116 | public int getResponseCode() { 117 | return responseCode_; 118 | } 119 | 120 | public static final int RESPONSE_ERROR_FIELD_NUMBER = 2; 121 | private volatile java.lang.Object responseError_; 122 | /** 123 | * optional string response_error = 2; 124 | */ 125 | public java.lang.String getResponseError() { 126 | java.lang.Object ref = responseError_; 127 | if (ref instanceof java.lang.String) { 128 | return (java.lang.String) ref; 129 | } else { 130 | com.google.protobuf.ByteString bs = 131 | (com.google.protobuf.ByteString) ref; 132 | java.lang.String s = bs.toStringUtf8(); 133 | responseError_ = s; 134 | return s; 135 | } 136 | } 137 | /** 138 | * optional string response_error = 2; 139 | */ 140 | public com.google.protobuf.ByteString 141 | getResponseErrorBytes() { 142 | java.lang.Object ref = responseError_; 143 | if (ref instanceof java.lang.String) { 144 | com.google.protobuf.ByteString b = 145 | com.google.protobuf.ByteString.copyFromUtf8( 146 | (java.lang.String) ref); 147 | responseError_ = b; 148 | return b; 149 | } else { 150 | return (com.google.protobuf.ByteString) ref; 151 | } 152 | } 153 | 154 | private byte memoizedIsInitialized = -1; 155 | public final boolean isInitialized() { 156 | byte isInitialized = memoizedIsInitialized; 157 | if (isInitialized == 1) return true; 158 | if (isInitialized == 0) return false; 159 | 160 | memoizedIsInitialized = 1; 161 | return true; 162 | } 163 | 164 | public void writeTo(com.google.protobuf.CodedOutputStream output) 165 | throws java.io.IOException { 166 | if (responseCode_ != 0) { 167 | output.writeInt32(1, responseCode_); 168 | } 169 | if (!getResponseErrorBytes().isEmpty()) { 170 | com.google.protobuf.GeneratedMessageV3.writeString(output, 2, responseError_); 171 | } 172 | } 173 | 174 | public int getSerializedSize() { 175 | int size = memoizedSize; 176 | if (size != -1) return size; 177 | 178 | size = 0; 179 | if (responseCode_ != 0) { 180 | size += com.google.protobuf.CodedOutputStream 181 | .computeInt32Size(1, responseCode_); 182 | } 183 | if (!getResponseErrorBytes().isEmpty()) { 184 | size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, responseError_); 185 | } 186 | memoizedSize = size; 187 | return size; 188 | } 189 | 190 | private static final long serialVersionUID = 0L; 191 | @java.lang.Override 192 | public boolean equals(final java.lang.Object obj) { 193 | if (obj == this) { 194 | return true; 195 | } 196 | if (!(obj instanceof coprocess.CoprocessReturnOverrides.ReturnOverrides)) { 197 | return super.equals(obj); 198 | } 199 | coprocess.CoprocessReturnOverrides.ReturnOverrides other = (coprocess.CoprocessReturnOverrides.ReturnOverrides) obj; 200 | 201 | boolean result = true; 202 | result = result && (getResponseCode() 203 | == other.getResponseCode()); 204 | result = result && getResponseError() 205 | .equals(other.getResponseError()); 206 | return result; 207 | } 208 | 209 | @java.lang.Override 210 | public int hashCode() { 211 | if (memoizedHashCode != 0) { 212 | return memoizedHashCode; 213 | } 214 | int hash = 41; 215 | hash = (19 * hash) + getDescriptorForType().hashCode(); 216 | hash = (37 * hash) + RESPONSE_CODE_FIELD_NUMBER; 217 | hash = (53 * hash) + getResponseCode(); 218 | hash = (37 * hash) + RESPONSE_ERROR_FIELD_NUMBER; 219 | hash = (53 * hash) + getResponseError().hashCode(); 220 | hash = (29 * hash) + unknownFields.hashCode(); 221 | memoizedHashCode = hash; 222 | return hash; 223 | } 224 | 225 | public static coprocess.CoprocessReturnOverrides.ReturnOverrides parseFrom( 226 | com.google.protobuf.ByteString data) 227 | throws com.google.protobuf.InvalidProtocolBufferException { 228 | return PARSER.parseFrom(data); 229 | } 230 | public static coprocess.CoprocessReturnOverrides.ReturnOverrides parseFrom( 231 | com.google.protobuf.ByteString data, 232 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 233 | throws com.google.protobuf.InvalidProtocolBufferException { 234 | return PARSER.parseFrom(data, extensionRegistry); 235 | } 236 | public static coprocess.CoprocessReturnOverrides.ReturnOverrides parseFrom(byte[] data) 237 | throws com.google.protobuf.InvalidProtocolBufferException { 238 | return PARSER.parseFrom(data); 239 | } 240 | public static coprocess.CoprocessReturnOverrides.ReturnOverrides parseFrom( 241 | byte[] data, 242 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 243 | throws com.google.protobuf.InvalidProtocolBufferException { 244 | return PARSER.parseFrom(data, extensionRegistry); 245 | } 246 | public static coprocess.CoprocessReturnOverrides.ReturnOverrides parseFrom(java.io.InputStream input) 247 | throws java.io.IOException { 248 | return com.google.protobuf.GeneratedMessageV3 249 | .parseWithIOException(PARSER, input); 250 | } 251 | public static coprocess.CoprocessReturnOverrides.ReturnOverrides parseFrom( 252 | java.io.InputStream input, 253 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 254 | throws java.io.IOException { 255 | return com.google.protobuf.GeneratedMessageV3 256 | .parseWithIOException(PARSER, input, extensionRegistry); 257 | } 258 | public static coprocess.CoprocessReturnOverrides.ReturnOverrides parseDelimitedFrom(java.io.InputStream input) 259 | throws java.io.IOException { 260 | return com.google.protobuf.GeneratedMessageV3 261 | .parseDelimitedWithIOException(PARSER, input); 262 | } 263 | public static coprocess.CoprocessReturnOverrides.ReturnOverrides parseDelimitedFrom( 264 | java.io.InputStream input, 265 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 266 | throws java.io.IOException { 267 | return com.google.protobuf.GeneratedMessageV3 268 | .parseDelimitedWithIOException(PARSER, input, extensionRegistry); 269 | } 270 | public static coprocess.CoprocessReturnOverrides.ReturnOverrides parseFrom( 271 | com.google.protobuf.CodedInputStream input) 272 | throws java.io.IOException { 273 | return com.google.protobuf.GeneratedMessageV3 274 | .parseWithIOException(PARSER, input); 275 | } 276 | public static coprocess.CoprocessReturnOverrides.ReturnOverrides parseFrom( 277 | com.google.protobuf.CodedInputStream input, 278 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 279 | throws java.io.IOException { 280 | return com.google.protobuf.GeneratedMessageV3 281 | .parseWithIOException(PARSER, input, extensionRegistry); 282 | } 283 | 284 | public Builder newBuilderForType() { return newBuilder(); } 285 | public static Builder newBuilder() { 286 | return DEFAULT_INSTANCE.toBuilder(); 287 | } 288 | public static Builder newBuilder(coprocess.CoprocessReturnOverrides.ReturnOverrides prototype) { 289 | return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 290 | } 291 | public Builder toBuilder() { 292 | return this == DEFAULT_INSTANCE 293 | ? new Builder() : new Builder().mergeFrom(this); 294 | } 295 | 296 | @java.lang.Override 297 | protected Builder newBuilderForType( 298 | com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 299 | Builder builder = new Builder(parent); 300 | return builder; 301 | } 302 | /** 303 | * Protobuf type {@code coprocess.ReturnOverrides} 304 | */ 305 | public static final class Builder extends 306 | com.google.protobuf.GeneratedMessageV3.Builder implements 307 | // @@protoc_insertion_point(builder_implements:coprocess.ReturnOverrides) 308 | coprocess.CoprocessReturnOverrides.ReturnOverridesOrBuilder { 309 | public static final com.google.protobuf.Descriptors.Descriptor 310 | getDescriptor() { 311 | return coprocess.CoprocessReturnOverrides.internal_static_coprocess_ReturnOverrides_descriptor; 312 | } 313 | 314 | protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable 315 | internalGetFieldAccessorTable() { 316 | return coprocess.CoprocessReturnOverrides.internal_static_coprocess_ReturnOverrides_fieldAccessorTable 317 | .ensureFieldAccessorsInitialized( 318 | coprocess.CoprocessReturnOverrides.ReturnOverrides.class, coprocess.CoprocessReturnOverrides.ReturnOverrides.Builder.class); 319 | } 320 | 321 | // Construct using coprocess.CoprocessReturnOverrides.ReturnOverrides.newBuilder() 322 | private Builder() { 323 | maybeForceBuilderInitialization(); 324 | } 325 | 326 | private Builder( 327 | com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 328 | super(parent); 329 | maybeForceBuilderInitialization(); 330 | } 331 | private void maybeForceBuilderInitialization() { 332 | if (com.google.protobuf.GeneratedMessageV3 333 | .alwaysUseFieldBuilders) { 334 | } 335 | } 336 | public Builder clear() { 337 | super.clear(); 338 | responseCode_ = 0; 339 | 340 | responseError_ = ""; 341 | 342 | return this; 343 | } 344 | 345 | public com.google.protobuf.Descriptors.Descriptor 346 | getDescriptorForType() { 347 | return coprocess.CoprocessReturnOverrides.internal_static_coprocess_ReturnOverrides_descriptor; 348 | } 349 | 350 | public coprocess.CoprocessReturnOverrides.ReturnOverrides getDefaultInstanceForType() { 351 | return coprocess.CoprocessReturnOverrides.ReturnOverrides.getDefaultInstance(); 352 | } 353 | 354 | public coprocess.CoprocessReturnOverrides.ReturnOverrides build() { 355 | coprocess.CoprocessReturnOverrides.ReturnOverrides result = buildPartial(); 356 | if (!result.isInitialized()) { 357 | throw newUninitializedMessageException(result); 358 | } 359 | return result; 360 | } 361 | 362 | public coprocess.CoprocessReturnOverrides.ReturnOverrides buildPartial() { 363 | coprocess.CoprocessReturnOverrides.ReturnOverrides result = new coprocess.CoprocessReturnOverrides.ReturnOverrides(this); 364 | result.responseCode_ = responseCode_; 365 | result.responseError_ = responseError_; 366 | onBuilt(); 367 | return result; 368 | } 369 | 370 | public Builder clone() { 371 | return (Builder) super.clone(); 372 | } 373 | public Builder setField( 374 | com.google.protobuf.Descriptors.FieldDescriptor field, 375 | Object value) { 376 | return (Builder) super.setField(field, value); 377 | } 378 | public Builder clearField( 379 | com.google.protobuf.Descriptors.FieldDescriptor field) { 380 | return (Builder) super.clearField(field); 381 | } 382 | public Builder clearOneof( 383 | com.google.protobuf.Descriptors.OneofDescriptor oneof) { 384 | return (Builder) super.clearOneof(oneof); 385 | } 386 | public Builder setRepeatedField( 387 | com.google.protobuf.Descriptors.FieldDescriptor field, 388 | int index, Object value) { 389 | return (Builder) super.setRepeatedField(field, index, value); 390 | } 391 | public Builder addRepeatedField( 392 | com.google.protobuf.Descriptors.FieldDescriptor field, 393 | Object value) { 394 | return (Builder) super.addRepeatedField(field, value); 395 | } 396 | public Builder mergeFrom(com.google.protobuf.Message other) { 397 | if (other instanceof coprocess.CoprocessReturnOverrides.ReturnOverrides) { 398 | return mergeFrom((coprocess.CoprocessReturnOverrides.ReturnOverrides)other); 399 | } else { 400 | super.mergeFrom(other); 401 | return this; 402 | } 403 | } 404 | 405 | public Builder mergeFrom(coprocess.CoprocessReturnOverrides.ReturnOverrides other) { 406 | if (other == coprocess.CoprocessReturnOverrides.ReturnOverrides.getDefaultInstance()) return this; 407 | if (other.getResponseCode() != 0) { 408 | setResponseCode(other.getResponseCode()); 409 | } 410 | if (!other.getResponseError().isEmpty()) { 411 | responseError_ = other.responseError_; 412 | onChanged(); 413 | } 414 | onChanged(); 415 | return this; 416 | } 417 | 418 | public final boolean isInitialized() { 419 | return true; 420 | } 421 | 422 | public Builder mergeFrom( 423 | com.google.protobuf.CodedInputStream input, 424 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 425 | throws java.io.IOException { 426 | coprocess.CoprocessReturnOverrides.ReturnOverrides parsedMessage = null; 427 | try { 428 | parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); 429 | } catch (com.google.protobuf.InvalidProtocolBufferException e) { 430 | parsedMessage = (coprocess.CoprocessReturnOverrides.ReturnOverrides) e.getUnfinishedMessage(); 431 | throw e.unwrapIOException(); 432 | } finally { 433 | if (parsedMessage != null) { 434 | mergeFrom(parsedMessage); 435 | } 436 | } 437 | return this; 438 | } 439 | 440 | private int responseCode_ ; 441 | /** 442 | * optional int32 response_code = 1; 443 | */ 444 | public int getResponseCode() { 445 | return responseCode_; 446 | } 447 | /** 448 | * optional int32 response_code = 1; 449 | */ 450 | public Builder setResponseCode(int value) { 451 | 452 | responseCode_ = value; 453 | onChanged(); 454 | return this; 455 | } 456 | /** 457 | * optional int32 response_code = 1; 458 | */ 459 | public Builder clearResponseCode() { 460 | 461 | responseCode_ = 0; 462 | onChanged(); 463 | return this; 464 | } 465 | 466 | private java.lang.Object responseError_ = ""; 467 | /** 468 | * optional string response_error = 2; 469 | */ 470 | public java.lang.String getResponseError() { 471 | java.lang.Object ref = responseError_; 472 | if (!(ref instanceof java.lang.String)) { 473 | com.google.protobuf.ByteString bs = 474 | (com.google.protobuf.ByteString) ref; 475 | java.lang.String s = bs.toStringUtf8(); 476 | responseError_ = s; 477 | return s; 478 | } else { 479 | return (java.lang.String) ref; 480 | } 481 | } 482 | /** 483 | * optional string response_error = 2; 484 | */ 485 | public com.google.protobuf.ByteString 486 | getResponseErrorBytes() { 487 | java.lang.Object ref = responseError_; 488 | if (ref instanceof String) { 489 | com.google.protobuf.ByteString b = 490 | com.google.protobuf.ByteString.copyFromUtf8( 491 | (java.lang.String) ref); 492 | responseError_ = b; 493 | return b; 494 | } else { 495 | return (com.google.protobuf.ByteString) ref; 496 | } 497 | } 498 | /** 499 | * optional string response_error = 2; 500 | */ 501 | public Builder setResponseError( 502 | java.lang.String value) { 503 | if (value == null) { 504 | throw new NullPointerException(); 505 | } 506 | 507 | responseError_ = value; 508 | onChanged(); 509 | return this; 510 | } 511 | /** 512 | * optional string response_error = 2; 513 | */ 514 | public Builder clearResponseError() { 515 | 516 | responseError_ = getDefaultInstance().getResponseError(); 517 | onChanged(); 518 | return this; 519 | } 520 | /** 521 | * optional string response_error = 2; 522 | */ 523 | public Builder setResponseErrorBytes( 524 | com.google.protobuf.ByteString value) { 525 | if (value == null) { 526 | throw new NullPointerException(); 527 | } 528 | checkByteStringIsUtf8(value); 529 | 530 | responseError_ = value; 531 | onChanged(); 532 | return this; 533 | } 534 | public final Builder setUnknownFields( 535 | final com.google.protobuf.UnknownFieldSet unknownFields) { 536 | return this; 537 | } 538 | 539 | public final Builder mergeUnknownFields( 540 | final com.google.protobuf.UnknownFieldSet unknownFields) { 541 | return this; 542 | } 543 | 544 | 545 | // @@protoc_insertion_point(builder_scope:coprocess.ReturnOverrides) 546 | } 547 | 548 | // @@protoc_insertion_point(class_scope:coprocess.ReturnOverrides) 549 | private static final coprocess.CoprocessReturnOverrides.ReturnOverrides DEFAULT_INSTANCE; 550 | static { 551 | DEFAULT_INSTANCE = new coprocess.CoprocessReturnOverrides.ReturnOverrides(); 552 | } 553 | 554 | public static coprocess.CoprocessReturnOverrides.ReturnOverrides getDefaultInstance() { 555 | return DEFAULT_INSTANCE; 556 | } 557 | 558 | private static final com.google.protobuf.Parser 559 | PARSER = new com.google.protobuf.AbstractParser() { 560 | public ReturnOverrides parsePartialFrom( 561 | com.google.protobuf.CodedInputStream input, 562 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 563 | throws com.google.protobuf.InvalidProtocolBufferException { 564 | return new ReturnOverrides(input, extensionRegistry); 565 | } 566 | }; 567 | 568 | public static com.google.protobuf.Parser parser() { 569 | return PARSER; 570 | } 571 | 572 | @java.lang.Override 573 | public com.google.protobuf.Parser getParserForType() { 574 | return PARSER; 575 | } 576 | 577 | public coprocess.CoprocessReturnOverrides.ReturnOverrides getDefaultInstanceForType() { 578 | return DEFAULT_INSTANCE; 579 | } 580 | 581 | } 582 | 583 | private static final com.google.protobuf.Descriptors.Descriptor 584 | internal_static_coprocess_ReturnOverrides_descriptor; 585 | private static final 586 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable 587 | internal_static_coprocess_ReturnOverrides_fieldAccessorTable; 588 | 589 | public static com.google.protobuf.Descriptors.FileDescriptor 590 | getDescriptor() { 591 | return descriptor; 592 | } 593 | private static com.google.protobuf.Descriptors.FileDescriptor 594 | descriptor; 595 | static { 596 | java.lang.String[] descriptorData = { 597 | "\n coprocess_return_overrides.proto\022\tcopr" + 598 | "ocess\"@\n\017ReturnOverrides\022\025\n\rresponse_cod" + 599 | "e\030\001 \001(\005\022\026\n\016response_error\030\002 \001(\tb\006proto3" 600 | }; 601 | com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = 602 | new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { 603 | public com.google.protobuf.ExtensionRegistry assignDescriptors( 604 | com.google.protobuf.Descriptors.FileDescriptor root) { 605 | descriptor = root; 606 | return null; 607 | } 608 | }; 609 | com.google.protobuf.Descriptors.FileDescriptor 610 | .internalBuildGeneratedFileFrom(descriptorData, 611 | new com.google.protobuf.Descriptors.FileDescriptor[] { 612 | }, assigner); 613 | internal_static_coprocess_ReturnOverrides_descriptor = 614 | getDescriptor().getMessageTypes().get(0); 615 | internal_static_coprocess_ReturnOverrides_fieldAccessorTable = new 616 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( 617 | internal_static_coprocess_ReturnOverrides_descriptor, 618 | new java.lang.String[] { "ResponseCode", "ResponseError", }); 619 | } 620 | 621 | // @@protoc_insertion_point(outer_class_scope) 622 | } 623 | -------------------------------------------------------------------------------- /bindings/java/DispatcherGrpc.java: -------------------------------------------------------------------------------- 1 | package coprocess; 2 | 3 | import static io.grpc.stub.ClientCalls.asyncUnaryCall; 4 | import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; 5 | import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; 6 | import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; 7 | import static io.grpc.stub.ClientCalls.blockingUnaryCall; 8 | import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; 9 | import static io.grpc.stub.ClientCalls.futureUnaryCall; 10 | import static io.grpc.MethodDescriptor.generateFullMethodName; 11 | import static io.grpc.stub.ServerCalls.asyncUnaryCall; 12 | import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; 13 | import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; 14 | import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; 15 | import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; 16 | import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; 17 | 18 | /** 19 | */ 20 | @javax.annotation.Generated( 21 | value = "by gRPC proto compiler (version 1.0.3)", 22 | comments = "Source: coprocess_object.proto") 23 | public class DispatcherGrpc { 24 | 25 | private DispatcherGrpc() {} 26 | 27 | public static final String SERVICE_NAME = "coprocess.Dispatcher"; 28 | 29 | // Static method descriptors that strictly reflect the proto. 30 | @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") 31 | public static final io.grpc.MethodDescriptor METHOD_DISPATCH = 33 | io.grpc.MethodDescriptor.create( 34 | io.grpc.MethodDescriptor.MethodType.UNARY, 35 | generateFullMethodName( 36 | "coprocess.Dispatcher", "Dispatch"), 37 | io.grpc.protobuf.ProtoUtils.marshaller(coprocess.CoprocessObject.Object.getDefaultInstance()), 38 | io.grpc.protobuf.ProtoUtils.marshaller(coprocess.CoprocessObject.Object.getDefaultInstance())); 39 | @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") 40 | public static final io.grpc.MethodDescriptor METHOD_DISPATCH_EVENT = 42 | io.grpc.MethodDescriptor.create( 43 | io.grpc.MethodDescriptor.MethodType.UNARY, 44 | generateFullMethodName( 45 | "coprocess.Dispatcher", "DispatchEvent"), 46 | io.grpc.protobuf.ProtoUtils.marshaller(coprocess.CoprocessObject.Event.getDefaultInstance()), 47 | io.grpc.protobuf.ProtoUtils.marshaller(coprocess.CoprocessObject.EventReply.getDefaultInstance())); 48 | 49 | /** 50 | * Creates a new async stub that supports all call types for the service 51 | */ 52 | public static DispatcherStub newStub(io.grpc.Channel channel) { 53 | return new DispatcherStub(channel); 54 | } 55 | 56 | /** 57 | * Creates a new blocking-style stub that supports unary and streaming output calls on the service 58 | */ 59 | public static DispatcherBlockingStub newBlockingStub( 60 | io.grpc.Channel channel) { 61 | return new DispatcherBlockingStub(channel); 62 | } 63 | 64 | /** 65 | * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service 66 | */ 67 | public static DispatcherFutureStub newFutureStub( 68 | io.grpc.Channel channel) { 69 | return new DispatcherFutureStub(channel); 70 | } 71 | 72 | /** 73 | */ 74 | public static abstract class DispatcherImplBase implements io.grpc.BindableService { 75 | 76 | /** 77 | */ 78 | public void dispatch(coprocess.CoprocessObject.Object request, 79 | io.grpc.stub.StreamObserver responseObserver) { 80 | asyncUnimplementedUnaryCall(METHOD_DISPATCH, responseObserver); 81 | } 82 | 83 | /** 84 | */ 85 | public void dispatchEvent(coprocess.CoprocessObject.Event request, 86 | io.grpc.stub.StreamObserver responseObserver) { 87 | asyncUnimplementedUnaryCall(METHOD_DISPATCH_EVENT, responseObserver); 88 | } 89 | 90 | @java.lang.Override public io.grpc.ServerServiceDefinition bindService() { 91 | return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) 92 | .addMethod( 93 | METHOD_DISPATCH, 94 | asyncUnaryCall( 95 | new MethodHandlers< 96 | coprocess.CoprocessObject.Object, 97 | coprocess.CoprocessObject.Object>( 98 | this, METHODID_DISPATCH))) 99 | .addMethod( 100 | METHOD_DISPATCH_EVENT, 101 | asyncUnaryCall( 102 | new MethodHandlers< 103 | coprocess.CoprocessObject.Event, 104 | coprocess.CoprocessObject.EventReply>( 105 | this, METHODID_DISPATCH_EVENT))) 106 | .build(); 107 | } 108 | } 109 | 110 | /** 111 | */ 112 | public static final class DispatcherStub extends io.grpc.stub.AbstractStub { 113 | private DispatcherStub(io.grpc.Channel channel) { 114 | super(channel); 115 | } 116 | 117 | private DispatcherStub(io.grpc.Channel channel, 118 | io.grpc.CallOptions callOptions) { 119 | super(channel, callOptions); 120 | } 121 | 122 | @java.lang.Override 123 | protected DispatcherStub build(io.grpc.Channel channel, 124 | io.grpc.CallOptions callOptions) { 125 | return new DispatcherStub(channel, callOptions); 126 | } 127 | 128 | /** 129 | */ 130 | public void dispatch(coprocess.CoprocessObject.Object request, 131 | io.grpc.stub.StreamObserver responseObserver) { 132 | asyncUnaryCall( 133 | getChannel().newCall(METHOD_DISPATCH, getCallOptions()), request, responseObserver); 134 | } 135 | 136 | /** 137 | */ 138 | public void dispatchEvent(coprocess.CoprocessObject.Event request, 139 | io.grpc.stub.StreamObserver responseObserver) { 140 | asyncUnaryCall( 141 | getChannel().newCall(METHOD_DISPATCH_EVENT, getCallOptions()), request, responseObserver); 142 | } 143 | } 144 | 145 | /** 146 | */ 147 | public static final class DispatcherBlockingStub extends io.grpc.stub.AbstractStub { 148 | private DispatcherBlockingStub(io.grpc.Channel channel) { 149 | super(channel); 150 | } 151 | 152 | private DispatcherBlockingStub(io.grpc.Channel channel, 153 | io.grpc.CallOptions callOptions) { 154 | super(channel, callOptions); 155 | } 156 | 157 | @java.lang.Override 158 | protected DispatcherBlockingStub build(io.grpc.Channel channel, 159 | io.grpc.CallOptions callOptions) { 160 | return new DispatcherBlockingStub(channel, callOptions); 161 | } 162 | 163 | /** 164 | */ 165 | public coprocess.CoprocessObject.Object dispatch(coprocess.CoprocessObject.Object request) { 166 | return blockingUnaryCall( 167 | getChannel(), METHOD_DISPATCH, getCallOptions(), request); 168 | } 169 | 170 | /** 171 | */ 172 | public coprocess.CoprocessObject.EventReply dispatchEvent(coprocess.CoprocessObject.Event request) { 173 | return blockingUnaryCall( 174 | getChannel(), METHOD_DISPATCH_EVENT, getCallOptions(), request); 175 | } 176 | } 177 | 178 | /** 179 | */ 180 | public static final class DispatcherFutureStub extends io.grpc.stub.AbstractStub { 181 | private DispatcherFutureStub(io.grpc.Channel channel) { 182 | super(channel); 183 | } 184 | 185 | private DispatcherFutureStub(io.grpc.Channel channel, 186 | io.grpc.CallOptions callOptions) { 187 | super(channel, callOptions); 188 | } 189 | 190 | @java.lang.Override 191 | protected DispatcherFutureStub build(io.grpc.Channel channel, 192 | io.grpc.CallOptions callOptions) { 193 | return new DispatcherFutureStub(channel, callOptions); 194 | } 195 | 196 | /** 197 | */ 198 | public com.google.common.util.concurrent.ListenableFuture dispatch( 199 | coprocess.CoprocessObject.Object request) { 200 | return futureUnaryCall( 201 | getChannel().newCall(METHOD_DISPATCH, getCallOptions()), request); 202 | } 203 | 204 | /** 205 | */ 206 | public com.google.common.util.concurrent.ListenableFuture dispatchEvent( 207 | coprocess.CoprocessObject.Event request) { 208 | return futureUnaryCall( 209 | getChannel().newCall(METHOD_DISPATCH_EVENT, getCallOptions()), request); 210 | } 211 | } 212 | 213 | private static final int METHODID_DISPATCH = 0; 214 | private static final int METHODID_DISPATCH_EVENT = 1; 215 | 216 | private static class MethodHandlers implements 217 | io.grpc.stub.ServerCalls.UnaryMethod, 218 | io.grpc.stub.ServerCalls.ServerStreamingMethod, 219 | io.grpc.stub.ServerCalls.ClientStreamingMethod, 220 | io.grpc.stub.ServerCalls.BidiStreamingMethod { 221 | private final DispatcherImplBase serviceImpl; 222 | private final int methodId; 223 | 224 | public MethodHandlers(DispatcherImplBase serviceImpl, int methodId) { 225 | this.serviceImpl = serviceImpl; 226 | this.methodId = methodId; 227 | } 228 | 229 | @java.lang.Override 230 | @java.lang.SuppressWarnings("unchecked") 231 | public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { 232 | switch (methodId) { 233 | case METHODID_DISPATCH: 234 | serviceImpl.dispatch((coprocess.CoprocessObject.Object) request, 235 | (io.grpc.stub.StreamObserver) responseObserver); 236 | break; 237 | case METHODID_DISPATCH_EVENT: 238 | serviceImpl.dispatchEvent((coprocess.CoprocessObject.Event) request, 239 | (io.grpc.stub.StreamObserver) responseObserver); 240 | break; 241 | default: 242 | throw new AssertionError(); 243 | } 244 | } 245 | 246 | @java.lang.Override 247 | @java.lang.SuppressWarnings("unchecked") 248 | public io.grpc.stub.StreamObserver invoke( 249 | io.grpc.stub.StreamObserver responseObserver) { 250 | switch (methodId) { 251 | default: 252 | throw new AssertionError(); 253 | } 254 | } 255 | } 256 | 257 | public static io.grpc.ServiceDescriptor getServiceDescriptor() { 258 | return new io.grpc.ServiceDescriptor(SERVICE_NAME, 259 | METHOD_DISPATCH, 260 | METHOD_DISPATCH_EVENT); 261 | } 262 | 263 | } 264 | -------------------------------------------------------------------------------- /bindings/python/.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | .hypothesis/ 47 | 48 | # Translations 49 | *.mo 50 | *.pot 51 | 52 | # Django stuff: 53 | *.log 54 | local_settings.py 55 | 56 | # Flask stuff: 57 | instance/ 58 | .webassets-cache 59 | 60 | # Scrapy stuff: 61 | .scrapy 62 | 63 | # Sphinx documentation 64 | docs/_build/ 65 | 66 | # PyBuilder 67 | target/ 68 | 69 | # IPython Notebook 70 | .ipynb_checkpoints 71 | 72 | # pyenv 73 | .python-version 74 | 75 | # celery beat schedule file 76 | celerybeat-schedule 77 | 78 | # dotenv 79 | .env 80 | 81 | # virtualenv 82 | venv/ 83 | ENV/ 84 | 85 | # Spyder project settings 86 | .spyderproject 87 | 88 | # Rope project settings 89 | .ropeproject 90 | -------------------------------------------------------------------------------- /bindings/python/coprocess_common_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: coprocess_common.proto 4 | 5 | from google.protobuf.internal import enum_type_wrapper 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 | # @@protoc_insertion_point(imports) 11 | 12 | _sym_db = _symbol_database.Default() 13 | 14 | 15 | 16 | 17 | DESCRIPTOR = _descriptor.FileDescriptor( 18 | name='coprocess_common.proto', 19 | package='coprocess', 20 | syntax='proto3', 21 | serialized_options=None, 22 | serialized_pb=b'\n\x16\x63oprocess_common.proto\x12\tcoprocess\"\x1c\n\x0bStringSlice\x12\r\n\x05items\x18\x01 \x03(\t*]\n\x08HookType\x12\x0b\n\x07Unknown\x10\x00\x12\x07\n\x03Pre\x10\x01\x12\x08\n\x04Post\x10\x02\x12\x0f\n\x0bPostKeyAuth\x10\x03\x12\x12\n\x0e\x43ustomKeyCheck\x10\x04\x12\x0c\n\x08Response\x10\x05\x62\x06proto3' 23 | ) 24 | 25 | _HOOKTYPE = _descriptor.EnumDescriptor( 26 | name='HookType', 27 | full_name='coprocess.HookType', 28 | filename=None, 29 | file=DESCRIPTOR, 30 | values=[ 31 | _descriptor.EnumValueDescriptor( 32 | name='Unknown', index=0, number=0, 33 | serialized_options=None, 34 | type=None), 35 | _descriptor.EnumValueDescriptor( 36 | name='Pre', index=1, number=1, 37 | serialized_options=None, 38 | type=None), 39 | _descriptor.EnumValueDescriptor( 40 | name='Post', index=2, number=2, 41 | serialized_options=None, 42 | type=None), 43 | _descriptor.EnumValueDescriptor( 44 | name='PostKeyAuth', index=3, number=3, 45 | serialized_options=None, 46 | type=None), 47 | _descriptor.EnumValueDescriptor( 48 | name='CustomKeyCheck', index=4, number=4, 49 | serialized_options=None, 50 | type=None), 51 | _descriptor.EnumValueDescriptor( 52 | name='Response', index=5, number=5, 53 | serialized_options=None, 54 | type=None), 55 | ], 56 | containing_type=None, 57 | serialized_options=None, 58 | serialized_start=67, 59 | serialized_end=160, 60 | ) 61 | _sym_db.RegisterEnumDescriptor(_HOOKTYPE) 62 | 63 | HookType = enum_type_wrapper.EnumTypeWrapper(_HOOKTYPE) 64 | Unknown = 0 65 | Pre = 1 66 | Post = 2 67 | PostKeyAuth = 3 68 | CustomKeyCheck = 4 69 | Response = 5 70 | 71 | 72 | 73 | _STRINGSLICE = _descriptor.Descriptor( 74 | name='StringSlice', 75 | full_name='coprocess.StringSlice', 76 | filename=None, 77 | file=DESCRIPTOR, 78 | containing_type=None, 79 | fields=[ 80 | _descriptor.FieldDescriptor( 81 | name='items', full_name='coprocess.StringSlice.items', index=0, 82 | number=1, type=9, cpp_type=9, label=3, 83 | has_default_value=False, default_value=[], 84 | message_type=None, enum_type=None, containing_type=None, 85 | is_extension=False, extension_scope=None, 86 | serialized_options=None, file=DESCRIPTOR), 87 | ], 88 | extensions=[ 89 | ], 90 | nested_types=[], 91 | enum_types=[ 92 | ], 93 | serialized_options=None, 94 | is_extendable=False, 95 | syntax='proto3', 96 | extension_ranges=[], 97 | oneofs=[ 98 | ], 99 | serialized_start=37, 100 | serialized_end=65, 101 | ) 102 | 103 | DESCRIPTOR.message_types_by_name['StringSlice'] = _STRINGSLICE 104 | DESCRIPTOR.enum_types_by_name['HookType'] = _HOOKTYPE 105 | _sym_db.RegisterFileDescriptor(DESCRIPTOR) 106 | 107 | StringSlice = _reflection.GeneratedProtocolMessageType('StringSlice', (_message.Message,), { 108 | 'DESCRIPTOR' : _STRINGSLICE, 109 | '__module__' : 'coprocess_common_pb2' 110 | # @@protoc_insertion_point(class_scope:coprocess.StringSlice) 111 | }) 112 | _sym_db.RegisterMessage(StringSlice) 113 | 114 | 115 | # @@protoc_insertion_point(module_scope) 116 | -------------------------------------------------------------------------------- /bindings/python/coprocess_grpc_pb2.py: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: coprocess_grpc.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 | import coprocess_mini_request_object_pb2 as coprocess__mini__request__object__pb2 17 | import coprocess_session_state_pb2 as coprocess__session__state__pb2 18 | import coprocess_common_pb2 as coprocess__common__pb2 19 | 20 | 21 | DESCRIPTOR = _descriptor.FileDescriptor( 22 | name='coprocess_grpc.proto', 23 | package='coprocess', 24 | syntax='proto3', 25 | serialized_pb=_b('\n\x14\x63oprocess_grpc.proto\x12\tcoprocess\x1a#coprocess_mini_request_object.proto\x1a\x1d\x63oprocess_session_state.proto\x1a\x16\x63oprocess_common.protob\x06proto3') 26 | , 27 | dependencies=[coprocess__mini__request__object__pb2.DESCRIPTOR,coprocess__session__state__pb2.DESCRIPTOR,coprocess__common__pb2.DESCRIPTOR,]) 28 | _sym_db.RegisterFileDescriptor(DESCRIPTOR) 29 | 30 | 31 | 32 | 33 | 34 | # @@protoc_insertion_point(module_scope) 35 | -------------------------------------------------------------------------------- /bindings/python/coprocess_mini_request_object_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: coprocess_mini_request_object.proto 4 | 5 | from google.protobuf import descriptor as _descriptor 6 | from google.protobuf import message as _message 7 | from google.protobuf import reflection as _reflection 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import coprocess_return_overrides_pb2 as coprocess__return__overrides__pb2 15 | 16 | 17 | DESCRIPTOR = _descriptor.FileDescriptor( 18 | name='coprocess_mini_request_object.proto', 19 | package='coprocess', 20 | syntax='proto3', 21 | serialized_options=None, 22 | serialized_pb=b'\n#coprocess_mini_request_object.proto\x12\tcoprocess\x1a coprocess_return_overrides.proto\"\x9a\x06\n\x11MiniRequestObject\x12:\n\x07headers\x18\x01 \x03(\x0b\x32).coprocess.MiniRequestObject.HeadersEntry\x12\x41\n\x0bset_headers\x18\x02 \x03(\x0b\x32,.coprocess.MiniRequestObject.SetHeadersEntry\x12\x16\n\x0e\x64\x65lete_headers\x18\x03 \x03(\t\x12\x0c\n\x04\x62ody\x18\x04 \x01(\t\x12\x0b\n\x03url\x18\x05 \x01(\t\x12\x38\n\x06params\x18\x06 \x03(\x0b\x32(.coprocess.MiniRequestObject.ParamsEntry\x12?\n\nadd_params\x18\x07 \x03(\x0b\x32+.coprocess.MiniRequestObject.AddParamsEntry\x12I\n\x0f\x65xtended_params\x18\x08 \x03(\x0b\x32\x30.coprocess.MiniRequestObject.ExtendedParamsEntry\x12\x15\n\rdelete_params\x18\t \x03(\t\x12\x34\n\x10return_overrides\x18\n \x01(\x0b\x32\x1a.coprocess.ReturnOverrides\x12\x0e\n\x06method\x18\x0b \x01(\t\x12\x13\n\x0brequest_uri\x18\x0c \x01(\t\x12\x0e\n\x06scheme\x18\r \x01(\t\x12\x10\n\x08raw_body\x18\x0e \x01(\x0c\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x31\n\x0fSetHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x30\n\x0e\x41\x64\x64ParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x35\n\x13\x45xtendedParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x62\x06proto3' 23 | , 24 | dependencies=[coprocess__return__overrides__pb2.DESCRIPTOR,]) 25 | 26 | 27 | 28 | 29 | _MINIREQUESTOBJECT_HEADERSENTRY = _descriptor.Descriptor( 30 | name='HeadersEntry', 31 | full_name='coprocess.MiniRequestObject.HeadersEntry', 32 | filename=None, 33 | file=DESCRIPTOR, 34 | containing_type=None, 35 | fields=[ 36 | _descriptor.FieldDescriptor( 37 | name='key', full_name='coprocess.MiniRequestObject.HeadersEntry.key', index=0, 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 | serialized_options=None, file=DESCRIPTOR), 43 | _descriptor.FieldDescriptor( 44 | name='value', full_name='coprocess.MiniRequestObject.HeadersEntry.value', index=1, 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 | serialized_options=None, file=DESCRIPTOR), 50 | ], 51 | extensions=[ 52 | ], 53 | nested_types=[], 54 | enum_types=[ 55 | ], 56 | serialized_options=b'8\001', 57 | is_extendable=False, 58 | syntax='proto3', 59 | extension_ranges=[], 60 | oneofs=[ 61 | ], 62 | serialized_start=630, 63 | serialized_end=676, 64 | ) 65 | 66 | _MINIREQUESTOBJECT_SETHEADERSENTRY = _descriptor.Descriptor( 67 | name='SetHeadersEntry', 68 | full_name='coprocess.MiniRequestObject.SetHeadersEntry', 69 | filename=None, 70 | file=DESCRIPTOR, 71 | containing_type=None, 72 | fields=[ 73 | _descriptor.FieldDescriptor( 74 | name='key', full_name='coprocess.MiniRequestObject.SetHeadersEntry.key', index=0, 75 | number=1, type=9, cpp_type=9, label=1, 76 | has_default_value=False, default_value=b"".decode('utf-8'), 77 | message_type=None, enum_type=None, containing_type=None, 78 | is_extension=False, extension_scope=None, 79 | serialized_options=None, file=DESCRIPTOR), 80 | _descriptor.FieldDescriptor( 81 | name='value', full_name='coprocess.MiniRequestObject.SetHeadersEntry.value', index=1, 82 | number=2, type=9, cpp_type=9, label=1, 83 | has_default_value=False, default_value=b"".decode('utf-8'), 84 | message_type=None, enum_type=None, containing_type=None, 85 | is_extension=False, extension_scope=None, 86 | serialized_options=None, file=DESCRIPTOR), 87 | ], 88 | extensions=[ 89 | ], 90 | nested_types=[], 91 | enum_types=[ 92 | ], 93 | serialized_options=b'8\001', 94 | is_extendable=False, 95 | syntax='proto3', 96 | extension_ranges=[], 97 | oneofs=[ 98 | ], 99 | serialized_start=678, 100 | serialized_end=727, 101 | ) 102 | 103 | _MINIREQUESTOBJECT_PARAMSENTRY = _descriptor.Descriptor( 104 | name='ParamsEntry', 105 | full_name='coprocess.MiniRequestObject.ParamsEntry', 106 | filename=None, 107 | file=DESCRIPTOR, 108 | containing_type=None, 109 | fields=[ 110 | _descriptor.FieldDescriptor( 111 | name='key', full_name='coprocess.MiniRequestObject.ParamsEntry.key', index=0, 112 | number=1, type=9, cpp_type=9, label=1, 113 | has_default_value=False, default_value=b"".decode('utf-8'), 114 | message_type=None, enum_type=None, containing_type=None, 115 | is_extension=False, extension_scope=None, 116 | serialized_options=None, file=DESCRIPTOR), 117 | _descriptor.FieldDescriptor( 118 | name='value', full_name='coprocess.MiniRequestObject.ParamsEntry.value', index=1, 119 | number=2, type=9, cpp_type=9, label=1, 120 | has_default_value=False, default_value=b"".decode('utf-8'), 121 | message_type=None, enum_type=None, containing_type=None, 122 | is_extension=False, extension_scope=None, 123 | serialized_options=None, file=DESCRIPTOR), 124 | ], 125 | extensions=[ 126 | ], 127 | nested_types=[], 128 | enum_types=[ 129 | ], 130 | serialized_options=b'8\001', 131 | is_extendable=False, 132 | syntax='proto3', 133 | extension_ranges=[], 134 | oneofs=[ 135 | ], 136 | serialized_start=729, 137 | serialized_end=774, 138 | ) 139 | 140 | _MINIREQUESTOBJECT_ADDPARAMSENTRY = _descriptor.Descriptor( 141 | name='AddParamsEntry', 142 | full_name='coprocess.MiniRequestObject.AddParamsEntry', 143 | filename=None, 144 | file=DESCRIPTOR, 145 | containing_type=None, 146 | fields=[ 147 | _descriptor.FieldDescriptor( 148 | name='key', full_name='coprocess.MiniRequestObject.AddParamsEntry.key', index=0, 149 | number=1, type=9, cpp_type=9, label=1, 150 | has_default_value=False, default_value=b"".decode('utf-8'), 151 | message_type=None, enum_type=None, containing_type=None, 152 | is_extension=False, extension_scope=None, 153 | serialized_options=None, file=DESCRIPTOR), 154 | _descriptor.FieldDescriptor( 155 | name='value', full_name='coprocess.MiniRequestObject.AddParamsEntry.value', index=1, 156 | number=2, type=9, cpp_type=9, label=1, 157 | has_default_value=False, default_value=b"".decode('utf-8'), 158 | message_type=None, enum_type=None, containing_type=None, 159 | is_extension=False, extension_scope=None, 160 | serialized_options=None, file=DESCRIPTOR), 161 | ], 162 | extensions=[ 163 | ], 164 | nested_types=[], 165 | enum_types=[ 166 | ], 167 | serialized_options=b'8\001', 168 | is_extendable=False, 169 | syntax='proto3', 170 | extension_ranges=[], 171 | oneofs=[ 172 | ], 173 | serialized_start=776, 174 | serialized_end=824, 175 | ) 176 | 177 | _MINIREQUESTOBJECT_EXTENDEDPARAMSENTRY = _descriptor.Descriptor( 178 | name='ExtendedParamsEntry', 179 | full_name='coprocess.MiniRequestObject.ExtendedParamsEntry', 180 | filename=None, 181 | file=DESCRIPTOR, 182 | containing_type=None, 183 | fields=[ 184 | _descriptor.FieldDescriptor( 185 | name='key', full_name='coprocess.MiniRequestObject.ExtendedParamsEntry.key', index=0, 186 | number=1, type=9, cpp_type=9, label=1, 187 | has_default_value=False, default_value=b"".decode('utf-8'), 188 | message_type=None, enum_type=None, containing_type=None, 189 | is_extension=False, extension_scope=None, 190 | serialized_options=None, file=DESCRIPTOR), 191 | _descriptor.FieldDescriptor( 192 | name='value', full_name='coprocess.MiniRequestObject.ExtendedParamsEntry.value', index=1, 193 | number=2, type=9, cpp_type=9, label=1, 194 | has_default_value=False, default_value=b"".decode('utf-8'), 195 | message_type=None, enum_type=None, containing_type=None, 196 | is_extension=False, extension_scope=None, 197 | serialized_options=None, file=DESCRIPTOR), 198 | ], 199 | extensions=[ 200 | ], 201 | nested_types=[], 202 | enum_types=[ 203 | ], 204 | serialized_options=b'8\001', 205 | is_extendable=False, 206 | syntax='proto3', 207 | extension_ranges=[], 208 | oneofs=[ 209 | ], 210 | serialized_start=826, 211 | serialized_end=879, 212 | ) 213 | 214 | _MINIREQUESTOBJECT = _descriptor.Descriptor( 215 | name='MiniRequestObject', 216 | full_name='coprocess.MiniRequestObject', 217 | filename=None, 218 | file=DESCRIPTOR, 219 | containing_type=None, 220 | fields=[ 221 | _descriptor.FieldDescriptor( 222 | name='headers', full_name='coprocess.MiniRequestObject.headers', index=0, 223 | number=1, type=11, cpp_type=10, label=3, 224 | has_default_value=False, default_value=[], 225 | message_type=None, enum_type=None, containing_type=None, 226 | is_extension=False, extension_scope=None, 227 | serialized_options=None, file=DESCRIPTOR), 228 | _descriptor.FieldDescriptor( 229 | name='set_headers', full_name='coprocess.MiniRequestObject.set_headers', index=1, 230 | number=2, type=11, cpp_type=10, label=3, 231 | has_default_value=False, default_value=[], 232 | message_type=None, enum_type=None, containing_type=None, 233 | is_extension=False, extension_scope=None, 234 | serialized_options=None, file=DESCRIPTOR), 235 | _descriptor.FieldDescriptor( 236 | name='delete_headers', full_name='coprocess.MiniRequestObject.delete_headers', index=2, 237 | number=3, type=9, cpp_type=9, label=3, 238 | has_default_value=False, default_value=[], 239 | message_type=None, enum_type=None, containing_type=None, 240 | is_extension=False, extension_scope=None, 241 | serialized_options=None, file=DESCRIPTOR), 242 | _descriptor.FieldDescriptor( 243 | name='body', full_name='coprocess.MiniRequestObject.body', index=3, 244 | number=4, type=9, cpp_type=9, label=1, 245 | has_default_value=False, default_value=b"".decode('utf-8'), 246 | message_type=None, enum_type=None, containing_type=None, 247 | is_extension=False, extension_scope=None, 248 | serialized_options=None, file=DESCRIPTOR), 249 | _descriptor.FieldDescriptor( 250 | name='url', full_name='coprocess.MiniRequestObject.url', index=4, 251 | number=5, type=9, cpp_type=9, label=1, 252 | has_default_value=False, default_value=b"".decode('utf-8'), 253 | message_type=None, enum_type=None, containing_type=None, 254 | is_extension=False, extension_scope=None, 255 | serialized_options=None, file=DESCRIPTOR), 256 | _descriptor.FieldDescriptor( 257 | name='params', full_name='coprocess.MiniRequestObject.params', index=5, 258 | number=6, type=11, cpp_type=10, label=3, 259 | has_default_value=False, default_value=[], 260 | message_type=None, enum_type=None, containing_type=None, 261 | is_extension=False, extension_scope=None, 262 | serialized_options=None, file=DESCRIPTOR), 263 | _descriptor.FieldDescriptor( 264 | name='add_params', full_name='coprocess.MiniRequestObject.add_params', index=6, 265 | number=7, type=11, cpp_type=10, label=3, 266 | has_default_value=False, default_value=[], 267 | message_type=None, enum_type=None, containing_type=None, 268 | is_extension=False, extension_scope=None, 269 | serialized_options=None, file=DESCRIPTOR), 270 | _descriptor.FieldDescriptor( 271 | name='extended_params', full_name='coprocess.MiniRequestObject.extended_params', index=7, 272 | number=8, type=11, cpp_type=10, label=3, 273 | has_default_value=False, default_value=[], 274 | message_type=None, enum_type=None, containing_type=None, 275 | is_extension=False, extension_scope=None, 276 | serialized_options=None, file=DESCRIPTOR), 277 | _descriptor.FieldDescriptor( 278 | name='delete_params', full_name='coprocess.MiniRequestObject.delete_params', index=8, 279 | number=9, type=9, cpp_type=9, label=3, 280 | has_default_value=False, default_value=[], 281 | message_type=None, enum_type=None, containing_type=None, 282 | is_extension=False, extension_scope=None, 283 | serialized_options=None, file=DESCRIPTOR), 284 | _descriptor.FieldDescriptor( 285 | name='return_overrides', full_name='coprocess.MiniRequestObject.return_overrides', index=9, 286 | number=10, type=11, cpp_type=10, label=1, 287 | has_default_value=False, default_value=None, 288 | message_type=None, enum_type=None, containing_type=None, 289 | is_extension=False, extension_scope=None, 290 | serialized_options=None, file=DESCRIPTOR), 291 | _descriptor.FieldDescriptor( 292 | name='method', full_name='coprocess.MiniRequestObject.method', index=10, 293 | number=11, type=9, cpp_type=9, label=1, 294 | has_default_value=False, default_value=b"".decode('utf-8'), 295 | message_type=None, enum_type=None, containing_type=None, 296 | is_extension=False, extension_scope=None, 297 | serialized_options=None, file=DESCRIPTOR), 298 | _descriptor.FieldDescriptor( 299 | name='request_uri', full_name='coprocess.MiniRequestObject.request_uri', index=11, 300 | number=12, type=9, cpp_type=9, label=1, 301 | has_default_value=False, default_value=b"".decode('utf-8'), 302 | message_type=None, enum_type=None, containing_type=None, 303 | is_extension=False, extension_scope=None, 304 | serialized_options=None, file=DESCRIPTOR), 305 | _descriptor.FieldDescriptor( 306 | name='scheme', full_name='coprocess.MiniRequestObject.scheme', index=12, 307 | number=13, type=9, cpp_type=9, label=1, 308 | has_default_value=False, default_value=b"".decode('utf-8'), 309 | message_type=None, enum_type=None, containing_type=None, 310 | is_extension=False, extension_scope=None, 311 | serialized_options=None, file=DESCRIPTOR), 312 | _descriptor.FieldDescriptor( 313 | name='raw_body', full_name='coprocess.MiniRequestObject.raw_body', index=13, 314 | number=14, type=12, cpp_type=9, label=1, 315 | has_default_value=False, default_value=b"", 316 | message_type=None, enum_type=None, containing_type=None, 317 | is_extension=False, extension_scope=None, 318 | serialized_options=None, file=DESCRIPTOR), 319 | ], 320 | extensions=[ 321 | ], 322 | nested_types=[_MINIREQUESTOBJECT_HEADERSENTRY, _MINIREQUESTOBJECT_SETHEADERSENTRY, _MINIREQUESTOBJECT_PARAMSENTRY, _MINIREQUESTOBJECT_ADDPARAMSENTRY, _MINIREQUESTOBJECT_EXTENDEDPARAMSENTRY, ], 323 | enum_types=[ 324 | ], 325 | serialized_options=None, 326 | is_extendable=False, 327 | syntax='proto3', 328 | extension_ranges=[], 329 | oneofs=[ 330 | ], 331 | serialized_start=85, 332 | serialized_end=879, 333 | ) 334 | 335 | _MINIREQUESTOBJECT_HEADERSENTRY.containing_type = _MINIREQUESTOBJECT 336 | _MINIREQUESTOBJECT_SETHEADERSENTRY.containing_type = _MINIREQUESTOBJECT 337 | _MINIREQUESTOBJECT_PARAMSENTRY.containing_type = _MINIREQUESTOBJECT 338 | _MINIREQUESTOBJECT_ADDPARAMSENTRY.containing_type = _MINIREQUESTOBJECT 339 | _MINIREQUESTOBJECT_EXTENDEDPARAMSENTRY.containing_type = _MINIREQUESTOBJECT 340 | _MINIREQUESTOBJECT.fields_by_name['headers'].message_type = _MINIREQUESTOBJECT_HEADERSENTRY 341 | _MINIREQUESTOBJECT.fields_by_name['set_headers'].message_type = _MINIREQUESTOBJECT_SETHEADERSENTRY 342 | _MINIREQUESTOBJECT.fields_by_name['params'].message_type = _MINIREQUESTOBJECT_PARAMSENTRY 343 | _MINIREQUESTOBJECT.fields_by_name['add_params'].message_type = _MINIREQUESTOBJECT_ADDPARAMSENTRY 344 | _MINIREQUESTOBJECT.fields_by_name['extended_params'].message_type = _MINIREQUESTOBJECT_EXTENDEDPARAMSENTRY 345 | _MINIREQUESTOBJECT.fields_by_name['return_overrides'].message_type = coprocess__return__overrides__pb2._RETURNOVERRIDES 346 | DESCRIPTOR.message_types_by_name['MiniRequestObject'] = _MINIREQUESTOBJECT 347 | _sym_db.RegisterFileDescriptor(DESCRIPTOR) 348 | 349 | MiniRequestObject = _reflection.GeneratedProtocolMessageType('MiniRequestObject', (_message.Message,), { 350 | 351 | 'HeadersEntry' : _reflection.GeneratedProtocolMessageType('HeadersEntry', (_message.Message,), { 352 | 'DESCRIPTOR' : _MINIREQUESTOBJECT_HEADERSENTRY, 353 | '__module__' : 'coprocess_mini_request_object_pb2' 354 | # @@protoc_insertion_point(class_scope:coprocess.MiniRequestObject.HeadersEntry) 355 | }) 356 | , 357 | 358 | 'SetHeadersEntry' : _reflection.GeneratedProtocolMessageType('SetHeadersEntry', (_message.Message,), { 359 | 'DESCRIPTOR' : _MINIREQUESTOBJECT_SETHEADERSENTRY, 360 | '__module__' : 'coprocess_mini_request_object_pb2' 361 | # @@protoc_insertion_point(class_scope:coprocess.MiniRequestObject.SetHeadersEntry) 362 | }) 363 | , 364 | 365 | 'ParamsEntry' : _reflection.GeneratedProtocolMessageType('ParamsEntry', (_message.Message,), { 366 | 'DESCRIPTOR' : _MINIREQUESTOBJECT_PARAMSENTRY, 367 | '__module__' : 'coprocess_mini_request_object_pb2' 368 | # @@protoc_insertion_point(class_scope:coprocess.MiniRequestObject.ParamsEntry) 369 | }) 370 | , 371 | 372 | 'AddParamsEntry' : _reflection.GeneratedProtocolMessageType('AddParamsEntry', (_message.Message,), { 373 | 'DESCRIPTOR' : _MINIREQUESTOBJECT_ADDPARAMSENTRY, 374 | '__module__' : 'coprocess_mini_request_object_pb2' 375 | # @@protoc_insertion_point(class_scope:coprocess.MiniRequestObject.AddParamsEntry) 376 | }) 377 | , 378 | 379 | 'ExtendedParamsEntry' : _reflection.GeneratedProtocolMessageType('ExtendedParamsEntry', (_message.Message,), { 380 | 'DESCRIPTOR' : _MINIREQUESTOBJECT_EXTENDEDPARAMSENTRY, 381 | '__module__' : 'coprocess_mini_request_object_pb2' 382 | # @@protoc_insertion_point(class_scope:coprocess.MiniRequestObject.ExtendedParamsEntry) 383 | }) 384 | , 385 | 'DESCRIPTOR' : _MINIREQUESTOBJECT, 386 | '__module__' : 'coprocess_mini_request_object_pb2' 387 | # @@protoc_insertion_point(class_scope:coprocess.MiniRequestObject) 388 | }) 389 | _sym_db.RegisterMessage(MiniRequestObject) 390 | _sym_db.RegisterMessage(MiniRequestObject.HeadersEntry) 391 | _sym_db.RegisterMessage(MiniRequestObject.SetHeadersEntry) 392 | _sym_db.RegisterMessage(MiniRequestObject.ParamsEntry) 393 | _sym_db.RegisterMessage(MiniRequestObject.AddParamsEntry) 394 | _sym_db.RegisterMessage(MiniRequestObject.ExtendedParamsEntry) 395 | 396 | 397 | _MINIREQUESTOBJECT_HEADERSENTRY._options = None 398 | _MINIREQUESTOBJECT_SETHEADERSENTRY._options = None 399 | _MINIREQUESTOBJECT_PARAMSENTRY._options = None 400 | _MINIREQUESTOBJECT_ADDPARAMSENTRY._options = None 401 | _MINIREQUESTOBJECT_EXTENDEDPARAMSENTRY._options = None 402 | # @@protoc_insertion_point(module_scope) 403 | -------------------------------------------------------------------------------- /bindings/python/coprocess_object_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: coprocess_object.proto 4 | 5 | from google.protobuf import descriptor as _descriptor 6 | from google.protobuf import message as _message 7 | from google.protobuf import reflection as _reflection 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import coprocess_mini_request_object_pb2 as coprocess__mini__request__object__pb2 15 | import coprocess_response_object_pb2 as coprocess__response__object__pb2 16 | import coprocess_session_state_pb2 as coprocess__session__state__pb2 17 | import coprocess_common_pb2 as coprocess__common__pb2 18 | 19 | 20 | DESCRIPTOR = _descriptor.FileDescriptor( 21 | name='coprocess_object.proto', 22 | package='coprocess', 23 | syntax='proto3', 24 | serialized_options=None, 25 | serialized_pb=b'\n\x16\x63oprocess_object.proto\x12\tcoprocess\x1a#coprocess_mini_request_object.proto\x1a\x1f\x63oprocess_response_object.proto\x1a\x1d\x63oprocess_session_state.proto\x1a\x16\x63oprocess_common.proto\"\x85\x03\n\x06Object\x12&\n\thook_type\x18\x01 \x01(\x0e\x32\x13.coprocess.HookType\x12\x11\n\thook_name\x18\x02 \x01(\t\x12-\n\x07request\x18\x03 \x01(\x0b\x32\x1c.coprocess.MiniRequestObject\x12(\n\x07session\x18\x04 \x01(\x0b\x32\x17.coprocess.SessionState\x12\x31\n\x08metadata\x18\x05 \x03(\x0b\x32\x1f.coprocess.Object.MetadataEntry\x12)\n\x04spec\x18\x06 \x03(\x0b\x32\x1b.coprocess.Object.SpecEntry\x12+\n\x08response\x18\x07 \x01(\x0b\x32\x19.coprocess.ResponseObject\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a+\n\tSpecEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x18\n\x05\x45vent\x12\x0f\n\x07payload\x18\x01 \x01(\t\"\x0c\n\nEventReply2|\n\nDispatcher\x12\x32\n\x08\x44ispatch\x12\x11.coprocess.Object\x1a\x11.coprocess.Object\"\x00\x12:\n\rDispatchEvent\x12\x10.coprocess.Event\x1a\x15.coprocess.EventReply\"\x00\x62\x06proto3' 26 | , 27 | dependencies=[coprocess__mini__request__object__pb2.DESCRIPTOR,coprocess__response__object__pb2.DESCRIPTOR,coprocess__session__state__pb2.DESCRIPTOR,coprocess__common__pb2.DESCRIPTOR,]) 28 | 29 | 30 | 31 | 32 | _OBJECT_METADATAENTRY = _descriptor.Descriptor( 33 | name='MetadataEntry', 34 | full_name='coprocess.Object.MetadataEntry', 35 | filename=None, 36 | file=DESCRIPTOR, 37 | containing_type=None, 38 | fields=[ 39 | _descriptor.FieldDescriptor( 40 | name='key', full_name='coprocess.Object.MetadataEntry.key', index=0, 41 | number=1, type=9, cpp_type=9, label=1, 42 | has_default_value=False, default_value=b"".decode('utf-8'), 43 | message_type=None, enum_type=None, containing_type=None, 44 | is_extension=False, extension_scope=None, 45 | serialized_options=None, file=DESCRIPTOR), 46 | _descriptor.FieldDescriptor( 47 | name='value', full_name='coprocess.Object.MetadataEntry.value', index=1, 48 | number=2, type=9, cpp_type=9, label=1, 49 | has_default_value=False, default_value=b"".decode('utf-8'), 50 | message_type=None, enum_type=None, containing_type=None, 51 | is_extension=False, extension_scope=None, 52 | serialized_options=None, file=DESCRIPTOR), 53 | ], 54 | extensions=[ 55 | ], 56 | nested_types=[], 57 | enum_types=[ 58 | ], 59 | serialized_options=b'8\001', 60 | is_extendable=False, 61 | syntax='proto3', 62 | extension_ranges=[], 63 | oneofs=[ 64 | ], 65 | serialized_start=460, 66 | serialized_end=507, 67 | ) 68 | 69 | _OBJECT_SPECENTRY = _descriptor.Descriptor( 70 | name='SpecEntry', 71 | full_name='coprocess.Object.SpecEntry', 72 | filename=None, 73 | file=DESCRIPTOR, 74 | containing_type=None, 75 | fields=[ 76 | _descriptor.FieldDescriptor( 77 | name='key', full_name='coprocess.Object.SpecEntry.key', index=0, 78 | number=1, type=9, cpp_type=9, label=1, 79 | has_default_value=False, default_value=b"".decode('utf-8'), 80 | message_type=None, enum_type=None, containing_type=None, 81 | is_extension=False, extension_scope=None, 82 | serialized_options=None, file=DESCRIPTOR), 83 | _descriptor.FieldDescriptor( 84 | name='value', full_name='coprocess.Object.SpecEntry.value', index=1, 85 | number=2, type=9, cpp_type=9, label=1, 86 | has_default_value=False, default_value=b"".decode('utf-8'), 87 | message_type=None, enum_type=None, containing_type=None, 88 | is_extension=False, extension_scope=None, 89 | serialized_options=None, file=DESCRIPTOR), 90 | ], 91 | extensions=[ 92 | ], 93 | nested_types=[], 94 | enum_types=[ 95 | ], 96 | serialized_options=b'8\001', 97 | is_extendable=False, 98 | syntax='proto3', 99 | extension_ranges=[], 100 | oneofs=[ 101 | ], 102 | serialized_start=509, 103 | serialized_end=552, 104 | ) 105 | 106 | _OBJECT = _descriptor.Descriptor( 107 | name='Object', 108 | full_name='coprocess.Object', 109 | filename=None, 110 | file=DESCRIPTOR, 111 | containing_type=None, 112 | fields=[ 113 | _descriptor.FieldDescriptor( 114 | name='hook_type', full_name='coprocess.Object.hook_type', index=0, 115 | number=1, type=14, cpp_type=8, label=1, 116 | has_default_value=False, default_value=0, 117 | message_type=None, enum_type=None, containing_type=None, 118 | is_extension=False, extension_scope=None, 119 | serialized_options=None, file=DESCRIPTOR), 120 | _descriptor.FieldDescriptor( 121 | name='hook_name', full_name='coprocess.Object.hook_name', index=1, 122 | number=2, type=9, cpp_type=9, label=1, 123 | has_default_value=False, default_value=b"".decode('utf-8'), 124 | message_type=None, enum_type=None, containing_type=None, 125 | is_extension=False, extension_scope=None, 126 | serialized_options=None, file=DESCRIPTOR), 127 | _descriptor.FieldDescriptor( 128 | name='request', full_name='coprocess.Object.request', index=2, 129 | number=3, type=11, cpp_type=10, label=1, 130 | has_default_value=False, default_value=None, 131 | message_type=None, enum_type=None, containing_type=None, 132 | is_extension=False, extension_scope=None, 133 | serialized_options=None, file=DESCRIPTOR), 134 | _descriptor.FieldDescriptor( 135 | name='session', full_name='coprocess.Object.session', index=3, 136 | number=4, type=11, cpp_type=10, label=1, 137 | has_default_value=False, default_value=None, 138 | message_type=None, enum_type=None, containing_type=None, 139 | is_extension=False, extension_scope=None, 140 | serialized_options=None, file=DESCRIPTOR), 141 | _descriptor.FieldDescriptor( 142 | name='metadata', full_name='coprocess.Object.metadata', index=4, 143 | number=5, type=11, cpp_type=10, label=3, 144 | has_default_value=False, default_value=[], 145 | message_type=None, enum_type=None, containing_type=None, 146 | is_extension=False, extension_scope=None, 147 | serialized_options=None, file=DESCRIPTOR), 148 | _descriptor.FieldDescriptor( 149 | name='spec', full_name='coprocess.Object.spec', index=5, 150 | number=6, type=11, cpp_type=10, label=3, 151 | has_default_value=False, default_value=[], 152 | message_type=None, enum_type=None, containing_type=None, 153 | is_extension=False, extension_scope=None, 154 | serialized_options=None, file=DESCRIPTOR), 155 | _descriptor.FieldDescriptor( 156 | name='response', full_name='coprocess.Object.response', index=6, 157 | number=7, type=11, cpp_type=10, label=1, 158 | has_default_value=False, default_value=None, 159 | message_type=None, enum_type=None, containing_type=None, 160 | is_extension=False, extension_scope=None, 161 | serialized_options=None, file=DESCRIPTOR), 162 | ], 163 | extensions=[ 164 | ], 165 | nested_types=[_OBJECT_METADATAENTRY, _OBJECT_SPECENTRY, ], 166 | enum_types=[ 167 | ], 168 | serialized_options=None, 169 | is_extendable=False, 170 | syntax='proto3', 171 | extension_ranges=[], 172 | oneofs=[ 173 | ], 174 | serialized_start=163, 175 | serialized_end=552, 176 | ) 177 | 178 | 179 | _EVENT = _descriptor.Descriptor( 180 | name='Event', 181 | full_name='coprocess.Event', 182 | filename=None, 183 | file=DESCRIPTOR, 184 | containing_type=None, 185 | fields=[ 186 | _descriptor.FieldDescriptor( 187 | name='payload', full_name='coprocess.Event.payload', index=0, 188 | number=1, type=9, cpp_type=9, label=1, 189 | has_default_value=False, default_value=b"".decode('utf-8'), 190 | message_type=None, enum_type=None, containing_type=None, 191 | is_extension=False, extension_scope=None, 192 | serialized_options=None, file=DESCRIPTOR), 193 | ], 194 | extensions=[ 195 | ], 196 | nested_types=[], 197 | enum_types=[ 198 | ], 199 | serialized_options=None, 200 | is_extendable=False, 201 | syntax='proto3', 202 | extension_ranges=[], 203 | oneofs=[ 204 | ], 205 | serialized_start=554, 206 | serialized_end=578, 207 | ) 208 | 209 | 210 | _EVENTREPLY = _descriptor.Descriptor( 211 | name='EventReply', 212 | full_name='coprocess.EventReply', 213 | filename=None, 214 | file=DESCRIPTOR, 215 | containing_type=None, 216 | fields=[ 217 | ], 218 | extensions=[ 219 | ], 220 | nested_types=[], 221 | enum_types=[ 222 | ], 223 | serialized_options=None, 224 | is_extendable=False, 225 | syntax='proto3', 226 | extension_ranges=[], 227 | oneofs=[ 228 | ], 229 | serialized_start=580, 230 | serialized_end=592, 231 | ) 232 | 233 | _OBJECT_METADATAENTRY.containing_type = _OBJECT 234 | _OBJECT_SPECENTRY.containing_type = _OBJECT 235 | _OBJECT.fields_by_name['hook_type'].enum_type = coprocess__common__pb2._HOOKTYPE 236 | _OBJECT.fields_by_name['request'].message_type = coprocess__mini__request__object__pb2._MINIREQUESTOBJECT 237 | _OBJECT.fields_by_name['session'].message_type = coprocess__session__state__pb2._SESSIONSTATE 238 | _OBJECT.fields_by_name['metadata'].message_type = _OBJECT_METADATAENTRY 239 | _OBJECT.fields_by_name['spec'].message_type = _OBJECT_SPECENTRY 240 | _OBJECT.fields_by_name['response'].message_type = coprocess__response__object__pb2._RESPONSEOBJECT 241 | DESCRIPTOR.message_types_by_name['Object'] = _OBJECT 242 | DESCRIPTOR.message_types_by_name['Event'] = _EVENT 243 | DESCRIPTOR.message_types_by_name['EventReply'] = _EVENTREPLY 244 | _sym_db.RegisterFileDescriptor(DESCRIPTOR) 245 | 246 | Object = _reflection.GeneratedProtocolMessageType('Object', (_message.Message,), { 247 | 248 | 'MetadataEntry' : _reflection.GeneratedProtocolMessageType('MetadataEntry', (_message.Message,), { 249 | 'DESCRIPTOR' : _OBJECT_METADATAENTRY, 250 | '__module__' : 'coprocess_object_pb2' 251 | # @@protoc_insertion_point(class_scope:coprocess.Object.MetadataEntry) 252 | }) 253 | , 254 | 255 | 'SpecEntry' : _reflection.GeneratedProtocolMessageType('SpecEntry', (_message.Message,), { 256 | 'DESCRIPTOR' : _OBJECT_SPECENTRY, 257 | '__module__' : 'coprocess_object_pb2' 258 | # @@protoc_insertion_point(class_scope:coprocess.Object.SpecEntry) 259 | }) 260 | , 261 | 'DESCRIPTOR' : _OBJECT, 262 | '__module__' : 'coprocess_object_pb2' 263 | # @@protoc_insertion_point(class_scope:coprocess.Object) 264 | }) 265 | _sym_db.RegisterMessage(Object) 266 | _sym_db.RegisterMessage(Object.MetadataEntry) 267 | _sym_db.RegisterMessage(Object.SpecEntry) 268 | 269 | Event = _reflection.GeneratedProtocolMessageType('Event', (_message.Message,), { 270 | 'DESCRIPTOR' : _EVENT, 271 | '__module__' : 'coprocess_object_pb2' 272 | # @@protoc_insertion_point(class_scope:coprocess.Event) 273 | }) 274 | _sym_db.RegisterMessage(Event) 275 | 276 | EventReply = _reflection.GeneratedProtocolMessageType('EventReply', (_message.Message,), { 277 | 'DESCRIPTOR' : _EVENTREPLY, 278 | '__module__' : 'coprocess_object_pb2' 279 | # @@protoc_insertion_point(class_scope:coprocess.EventReply) 280 | }) 281 | _sym_db.RegisterMessage(EventReply) 282 | 283 | 284 | _OBJECT_METADATAENTRY._options = None 285 | _OBJECT_SPECENTRY._options = None 286 | 287 | _DISPATCHER = _descriptor.ServiceDescriptor( 288 | name='Dispatcher', 289 | full_name='coprocess.Dispatcher', 290 | file=DESCRIPTOR, 291 | index=0, 292 | serialized_options=None, 293 | serialized_start=594, 294 | serialized_end=718, 295 | methods=[ 296 | _descriptor.MethodDescriptor( 297 | name='Dispatch', 298 | full_name='coprocess.Dispatcher.Dispatch', 299 | index=0, 300 | containing_service=None, 301 | input_type=_OBJECT, 302 | output_type=_OBJECT, 303 | serialized_options=None, 304 | ), 305 | _descriptor.MethodDescriptor( 306 | name='DispatchEvent', 307 | full_name='coprocess.Dispatcher.DispatchEvent', 308 | index=1, 309 | containing_service=None, 310 | input_type=_EVENT, 311 | output_type=_EVENTREPLY, 312 | serialized_options=None, 313 | ), 314 | ]) 315 | _sym_db.RegisterServiceDescriptor(_DISPATCHER) 316 | 317 | DESCRIPTOR.services_by_name['Dispatcher'] = _DISPATCHER 318 | 319 | # @@protoc_insertion_point(module_scope) 320 | -------------------------------------------------------------------------------- /bindings/python/coprocess_object_pb2_grpc.py: -------------------------------------------------------------------------------- 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2 | import grpc 3 | 4 | import coprocess_object_pb2 as coprocess__object__pb2 5 | 6 | 7 | class DispatcherStub(object): 8 | """Missing associated documentation comment in .proto file""" 9 | 10 | def __init__(self, channel): 11 | """Constructor. 12 | 13 | Args: 14 | channel: A grpc.Channel. 15 | """ 16 | self.Dispatch = channel.unary_unary( 17 | '/coprocess.Dispatcher/Dispatch', 18 | request_serializer=coprocess__object__pb2.Object.SerializeToString, 19 | response_deserializer=coprocess__object__pb2.Object.FromString, 20 | ) 21 | self.DispatchEvent = channel.unary_unary( 22 | '/coprocess.Dispatcher/DispatchEvent', 23 | request_serializer=coprocess__object__pb2.Event.SerializeToString, 24 | response_deserializer=coprocess__object__pb2.EventReply.FromString, 25 | ) 26 | 27 | 28 | class DispatcherServicer(object): 29 | """Missing associated documentation comment in .proto file""" 30 | 31 | def Dispatch(self, request, context): 32 | """Missing associated documentation comment in .proto file""" 33 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 34 | context.set_details('Method not implemented!') 35 | raise NotImplementedError('Method not implemented!') 36 | 37 | def DispatchEvent(self, request, context): 38 | """Missing associated documentation comment in .proto file""" 39 | context.set_code(grpc.StatusCode.UNIMPLEMENTED) 40 | context.set_details('Method not implemented!') 41 | raise NotImplementedError('Method not implemented!') 42 | 43 | 44 | def add_DispatcherServicer_to_server(servicer, server): 45 | rpc_method_handlers = { 46 | 'Dispatch': grpc.unary_unary_rpc_method_handler( 47 | servicer.Dispatch, 48 | request_deserializer=coprocess__object__pb2.Object.FromString, 49 | response_serializer=coprocess__object__pb2.Object.SerializeToString, 50 | ), 51 | 'DispatchEvent': grpc.unary_unary_rpc_method_handler( 52 | servicer.DispatchEvent, 53 | request_deserializer=coprocess__object__pb2.Event.FromString, 54 | response_serializer=coprocess__object__pb2.EventReply.SerializeToString, 55 | ), 56 | } 57 | generic_handler = grpc.method_handlers_generic_handler( 58 | 'coprocess.Dispatcher', rpc_method_handlers) 59 | server.add_generic_rpc_handlers((generic_handler,)) 60 | 61 | 62 | # This class is part of an EXPERIMENTAL API. 63 | class Dispatcher(object): 64 | """Missing associated documentation comment in .proto file""" 65 | 66 | @staticmethod 67 | def Dispatch(request, 68 | target, 69 | options=(), 70 | channel_credentials=None, 71 | call_credentials=None, 72 | compression=None, 73 | wait_for_ready=None, 74 | timeout=None, 75 | metadata=None): 76 | return grpc.experimental.unary_unary(request, target, '/coprocess.Dispatcher/Dispatch', 77 | coprocess__object__pb2.Object.SerializeToString, 78 | coprocess__object__pb2.Object.FromString, 79 | options, channel_credentials, 80 | call_credentials, compression, wait_for_ready, timeout, metadata) 81 | 82 | @staticmethod 83 | def DispatchEvent(request, 84 | target, 85 | options=(), 86 | channel_credentials=None, 87 | call_credentials=None, 88 | compression=None, 89 | wait_for_ready=None, 90 | timeout=None, 91 | metadata=None): 92 | return grpc.experimental.unary_unary(request, target, '/coprocess.Dispatcher/DispatchEvent', 93 | coprocess__object__pb2.Event.SerializeToString, 94 | coprocess__object__pb2.EventReply.FromString, 95 | options, channel_credentials, 96 | call_credentials, compression, wait_for_ready, timeout, metadata) 97 | -------------------------------------------------------------------------------- /bindings/python/coprocess_response_object_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: coprocess_response_object.proto 4 | 5 | from google.protobuf import descriptor as _descriptor 6 | from google.protobuf import message as _message 7 | from google.protobuf import reflection as _reflection 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | import coprocess_return_overrides_pb2 as coprocess__return__overrides__pb2 15 | 16 | 17 | DESCRIPTOR = _descriptor.FileDescriptor( 18 | name='coprocess_response_object.proto', 19 | package='coprocess', 20 | syntax='proto3', 21 | serialized_options=None, 22 | serialized_pb=b'\n\x1f\x63oprocess_response_object.proto\x12\tcoprocess\x1a coprocess_return_overrides.proto\"\xae\x01\n\x0eResponseObject\x12\x13\n\x0bstatus_code\x18\x01 \x01(\x05\x12\x10\n\x08raw_body\x18\x02 \x01(\x0c\x12\x0c\n\x04\x62ody\x18\x03 \x01(\t\x12\x37\n\x07headers\x18\x04 \x03(\x0b\x32&.coprocess.ResponseObject.HeadersEntry\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x62\x06proto3' 23 | , 24 | dependencies=[coprocess__return__overrides__pb2.DESCRIPTOR,]) 25 | 26 | 27 | 28 | 29 | _RESPONSEOBJECT_HEADERSENTRY = _descriptor.Descriptor( 30 | name='HeadersEntry', 31 | full_name='coprocess.ResponseObject.HeadersEntry', 32 | filename=None, 33 | file=DESCRIPTOR, 34 | containing_type=None, 35 | fields=[ 36 | _descriptor.FieldDescriptor( 37 | name='key', full_name='coprocess.ResponseObject.HeadersEntry.key', index=0, 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 | serialized_options=None, file=DESCRIPTOR), 43 | _descriptor.FieldDescriptor( 44 | name='value', full_name='coprocess.ResponseObject.HeadersEntry.value', index=1, 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 | serialized_options=None, file=DESCRIPTOR), 50 | ], 51 | extensions=[ 52 | ], 53 | nested_types=[], 54 | enum_types=[ 55 | ], 56 | serialized_options=b'8\001', 57 | is_extendable=False, 58 | syntax='proto3', 59 | extension_ranges=[], 60 | oneofs=[ 61 | ], 62 | serialized_start=209, 63 | serialized_end=255, 64 | ) 65 | 66 | _RESPONSEOBJECT = _descriptor.Descriptor( 67 | name='ResponseObject', 68 | full_name='coprocess.ResponseObject', 69 | filename=None, 70 | file=DESCRIPTOR, 71 | containing_type=None, 72 | fields=[ 73 | _descriptor.FieldDescriptor( 74 | name='status_code', full_name='coprocess.ResponseObject.status_code', index=0, 75 | number=1, type=5, cpp_type=1, label=1, 76 | has_default_value=False, default_value=0, 77 | message_type=None, enum_type=None, containing_type=None, 78 | is_extension=False, extension_scope=None, 79 | serialized_options=None, file=DESCRIPTOR), 80 | _descriptor.FieldDescriptor( 81 | name='raw_body', full_name='coprocess.ResponseObject.raw_body', index=1, 82 | number=2, type=12, cpp_type=9, label=1, 83 | has_default_value=False, default_value=b"", 84 | message_type=None, enum_type=None, containing_type=None, 85 | is_extension=False, extension_scope=None, 86 | serialized_options=None, file=DESCRIPTOR), 87 | _descriptor.FieldDescriptor( 88 | name='body', full_name='coprocess.ResponseObject.body', index=2, 89 | number=3, type=9, cpp_type=9, label=1, 90 | has_default_value=False, default_value=b"".decode('utf-8'), 91 | message_type=None, enum_type=None, containing_type=None, 92 | is_extension=False, extension_scope=None, 93 | serialized_options=None, file=DESCRIPTOR), 94 | _descriptor.FieldDescriptor( 95 | name='headers', full_name='coprocess.ResponseObject.headers', index=3, 96 | number=4, type=11, cpp_type=10, label=3, 97 | has_default_value=False, default_value=[], 98 | message_type=None, enum_type=None, containing_type=None, 99 | is_extension=False, extension_scope=None, 100 | serialized_options=None, file=DESCRIPTOR), 101 | ], 102 | extensions=[ 103 | ], 104 | nested_types=[_RESPONSEOBJECT_HEADERSENTRY, ], 105 | enum_types=[ 106 | ], 107 | serialized_options=None, 108 | is_extendable=False, 109 | syntax='proto3', 110 | extension_ranges=[], 111 | oneofs=[ 112 | ], 113 | serialized_start=81, 114 | serialized_end=255, 115 | ) 116 | 117 | _RESPONSEOBJECT_HEADERSENTRY.containing_type = _RESPONSEOBJECT 118 | _RESPONSEOBJECT.fields_by_name['headers'].message_type = _RESPONSEOBJECT_HEADERSENTRY 119 | DESCRIPTOR.message_types_by_name['ResponseObject'] = _RESPONSEOBJECT 120 | _sym_db.RegisterFileDescriptor(DESCRIPTOR) 121 | 122 | ResponseObject = _reflection.GeneratedProtocolMessageType('ResponseObject', (_message.Message,), { 123 | 124 | 'HeadersEntry' : _reflection.GeneratedProtocolMessageType('HeadersEntry', (_message.Message,), { 125 | 'DESCRIPTOR' : _RESPONSEOBJECT_HEADERSENTRY, 126 | '__module__' : 'coprocess_response_object_pb2' 127 | # @@protoc_insertion_point(class_scope:coprocess.ResponseObject.HeadersEntry) 128 | }) 129 | , 130 | 'DESCRIPTOR' : _RESPONSEOBJECT, 131 | '__module__' : 'coprocess_response_object_pb2' 132 | # @@protoc_insertion_point(class_scope:coprocess.ResponseObject) 133 | }) 134 | _sym_db.RegisterMessage(ResponseObject) 135 | _sym_db.RegisterMessage(ResponseObject.HeadersEntry) 136 | 137 | 138 | _RESPONSEOBJECT_HEADERSENTRY._options = None 139 | # @@protoc_insertion_point(module_scope) 140 | -------------------------------------------------------------------------------- /bindings/python/coprocess_return_overrides_pb2.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by the protocol buffer compiler. DO NOT EDIT! 3 | # source: coprocess_return_overrides.proto 4 | 5 | from google.protobuf import descriptor as _descriptor 6 | from google.protobuf import message as _message 7 | from google.protobuf import reflection as _reflection 8 | from google.protobuf import symbol_database as _symbol_database 9 | # @@protoc_insertion_point(imports) 10 | 11 | _sym_db = _symbol_database.Default() 12 | 13 | 14 | 15 | 16 | DESCRIPTOR = _descriptor.FileDescriptor( 17 | name='coprocess_return_overrides.proto', 18 | package='coprocess', 19 | syntax='proto3', 20 | serialized_options=None, 21 | serialized_pb=b'\n coprocess_return_overrides.proto\x12\tcoprocess\"\xd9\x01\n\x0fReturnOverrides\x12\x15\n\rresponse_code\x18\x01 \x01(\x05\x12\x16\n\x0eresponse_error\x18\x02 \x01(\t\x12\x38\n\x07headers\x18\x03 \x03(\x0b\x32\'.coprocess.ReturnOverrides.HeadersEntry\x12\x16\n\x0eoverride_error\x18\x04 \x01(\x08\x12\x15\n\rresponse_body\x18\x05 \x01(\t\x1a.\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x62\x06proto3' 22 | ) 23 | 24 | 25 | 26 | 27 | _RETURNOVERRIDES_HEADERSENTRY = _descriptor.Descriptor( 28 | name='HeadersEntry', 29 | full_name='coprocess.ReturnOverrides.HeadersEntry', 30 | filename=None, 31 | file=DESCRIPTOR, 32 | containing_type=None, 33 | fields=[ 34 | _descriptor.FieldDescriptor( 35 | name='key', full_name='coprocess.ReturnOverrides.HeadersEntry.key', index=0, 36 | number=1, type=9, cpp_type=9, label=1, 37 | has_default_value=False, default_value=b"".decode('utf-8'), 38 | message_type=None, enum_type=None, containing_type=None, 39 | is_extension=False, extension_scope=None, 40 | serialized_options=None, file=DESCRIPTOR), 41 | _descriptor.FieldDescriptor( 42 | name='value', full_name='coprocess.ReturnOverrides.HeadersEntry.value', index=1, 43 | number=2, type=9, cpp_type=9, label=1, 44 | has_default_value=False, default_value=b"".decode('utf-8'), 45 | message_type=None, enum_type=None, containing_type=None, 46 | is_extension=False, extension_scope=None, 47 | serialized_options=None, file=DESCRIPTOR), 48 | ], 49 | extensions=[ 50 | ], 51 | nested_types=[], 52 | enum_types=[ 53 | ], 54 | serialized_options=b'8\001', 55 | is_extendable=False, 56 | syntax='proto3', 57 | extension_ranges=[], 58 | oneofs=[ 59 | ], 60 | serialized_start=219, 61 | serialized_end=265, 62 | ) 63 | 64 | _RETURNOVERRIDES = _descriptor.Descriptor( 65 | name='ReturnOverrides', 66 | full_name='coprocess.ReturnOverrides', 67 | filename=None, 68 | file=DESCRIPTOR, 69 | containing_type=None, 70 | fields=[ 71 | _descriptor.FieldDescriptor( 72 | name='response_code', full_name='coprocess.ReturnOverrides.response_code', index=0, 73 | number=1, type=5, cpp_type=1, label=1, 74 | has_default_value=False, default_value=0, 75 | message_type=None, enum_type=None, containing_type=None, 76 | is_extension=False, extension_scope=None, 77 | serialized_options=None, file=DESCRIPTOR), 78 | _descriptor.FieldDescriptor( 79 | name='response_error', full_name='coprocess.ReturnOverrides.response_error', index=1, 80 | number=2, type=9, cpp_type=9, label=1, 81 | has_default_value=False, default_value=b"".decode('utf-8'), 82 | message_type=None, enum_type=None, containing_type=None, 83 | is_extension=False, extension_scope=None, 84 | serialized_options=None, file=DESCRIPTOR), 85 | _descriptor.FieldDescriptor( 86 | name='headers', full_name='coprocess.ReturnOverrides.headers', index=2, 87 | number=3, type=11, cpp_type=10, label=3, 88 | has_default_value=False, default_value=[], 89 | message_type=None, enum_type=None, containing_type=None, 90 | is_extension=False, extension_scope=None, 91 | serialized_options=None, file=DESCRIPTOR), 92 | _descriptor.FieldDescriptor( 93 | name='override_error', full_name='coprocess.ReturnOverrides.override_error', index=3, 94 | number=4, type=8, cpp_type=7, label=1, 95 | has_default_value=False, default_value=False, 96 | message_type=None, enum_type=None, containing_type=None, 97 | is_extension=False, extension_scope=None, 98 | serialized_options=None, file=DESCRIPTOR), 99 | _descriptor.FieldDescriptor( 100 | name='response_body', full_name='coprocess.ReturnOverrides.response_body', index=4, 101 | number=5, type=9, cpp_type=9, label=1, 102 | has_default_value=False, default_value=b"".decode('utf-8'), 103 | message_type=None, enum_type=None, containing_type=None, 104 | is_extension=False, extension_scope=None, 105 | serialized_options=None, file=DESCRIPTOR), 106 | ], 107 | extensions=[ 108 | ], 109 | nested_types=[_RETURNOVERRIDES_HEADERSENTRY, ], 110 | enum_types=[ 111 | ], 112 | serialized_options=None, 113 | is_extendable=False, 114 | syntax='proto3', 115 | extension_ranges=[], 116 | oneofs=[ 117 | ], 118 | serialized_start=48, 119 | serialized_end=265, 120 | ) 121 | 122 | _RETURNOVERRIDES_HEADERSENTRY.containing_type = _RETURNOVERRIDES 123 | _RETURNOVERRIDES.fields_by_name['headers'].message_type = _RETURNOVERRIDES_HEADERSENTRY 124 | DESCRIPTOR.message_types_by_name['ReturnOverrides'] = _RETURNOVERRIDES 125 | _sym_db.RegisterFileDescriptor(DESCRIPTOR) 126 | 127 | ReturnOverrides = _reflection.GeneratedProtocolMessageType('ReturnOverrides', (_message.Message,), { 128 | 129 | 'HeadersEntry' : _reflection.GeneratedProtocolMessageType('HeadersEntry', (_message.Message,), { 130 | 'DESCRIPTOR' : _RETURNOVERRIDES_HEADERSENTRY, 131 | '__module__' : 'coprocess_return_overrides_pb2' 132 | # @@protoc_insertion_point(class_scope:coprocess.ReturnOverrides.HeadersEntry) 133 | }) 134 | , 135 | 'DESCRIPTOR' : _RETURNOVERRIDES, 136 | '__module__' : 'coprocess_return_overrides_pb2' 137 | # @@protoc_insertion_point(class_scope:coprocess.ReturnOverrides) 138 | }) 139 | _sym_db.RegisterMessage(ReturnOverrides) 140 | _sym_db.RegisterMessage(ReturnOverrides.HeadersEntry) 141 | 142 | 143 | _RETURNOVERRIDES_HEADERSENTRY._options = None 144 | # @@protoc_insertion_point(module_scope) 145 | -------------------------------------------------------------------------------- /bindings/python/sample_server.py: -------------------------------------------------------------------------------- 1 | import coprocess_object_pb2 2 | from coprocess_session_state_pb2 import SessionState 3 | 4 | import grpc, time, json 5 | 6 | _ONE_DAY_IN_SECONDS = 60 * 60 * 24 7 | 8 | from concurrent import futures 9 | 10 | def MyPreMiddleware(coprocess_object): 11 | coprocess_object.request.set_headers["myheader"] = "myvalue" 12 | return coprocess_object 13 | 14 | def MyPostMiddleware(coprocess_object): 15 | coprocess_object.request.set_headers["anotherheader"] = "anothervalue" 16 | return coprocess_object 17 | 18 | def MyAuthCheck(coprocess_object): 19 | valid_token = 'aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d' 20 | request_token = coprocess_object.request.headers["Authorization"] 21 | 22 | if request_token == valid_token: 23 | new_session = SessionState() 24 | new_session.rate = 1000.0 25 | new_session.per = 1.0 26 | coprocess_object.metadata["token"] = "mytoken" 27 | coprocess_object.session.CopyFrom(new_session) 28 | 29 | else: 30 | coprocess_object.request.return_overrides.response_code = 401 31 | coprocess_object.request.return_overrides.response_error = 'Not authorized (Python middleware)' 32 | 33 | return coprocess_object 34 | 35 | class MyDispatcher(coprocess_object_pb2.DispatcherServicer): 36 | def Dispatch(self, coprocess_object, context): 37 | if coprocess_object.hook_name == "MyPreMiddleware": 38 | coprocess_object = MyPreMiddleware(coprocess_object) 39 | 40 | if coprocess_object.hook_name == "MyPostMiddleware": 41 | coprocess_object = MyPostMiddleware(coprocess_object) 42 | 43 | if coprocess_object.hook_name == "MyAuthCheck": 44 | coprocess_object = MyAuthCheck(coprocess_object) 45 | 46 | return coprocess_object 47 | 48 | def DispatchEvent(self, event_wrapper, context): 49 | event = json.loads(event_wrapper.payload) 50 | return coprocess_object_pb2.EventReply() 51 | 52 | 53 | def serve(): 54 | server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) 55 | coprocess_object_pb2.add_DispatcherServicer_to_server( 56 | MyDispatcher(), server) 57 | server.add_insecure_port('[::]:5555') 58 | server.start() 59 | try: 60 | while True: 61 | time.sleep(_ONE_DAY_IN_SECONDS) 62 | except KeyboardInterrupt: 63 | server.stop(0) 64 | 65 | if __name__ == '__main__': 66 | serve() 67 | -------------------------------------------------------------------------------- /bindings/ruby/coprocess_common_pb.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: coprocess_common.proto 3 | 4 | require 'google/protobuf' 5 | 6 | Google::Protobuf::DescriptorPool.generated_pool.build do 7 | add_file("coprocess_common.proto", :syntax => :proto3) do 8 | add_message "coprocess.StringSlice" do 9 | repeated :items, :string, 1 10 | end 11 | add_enum "coprocess.HookType" do 12 | value :Unknown, 0 13 | value :Pre, 1 14 | value :Post, 2 15 | value :PostKeyAuth, 3 16 | value :CustomKeyCheck, 4 17 | value :Response, 5 18 | end 19 | end 20 | end 21 | 22 | module Coprocess 23 | StringSlice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coprocess.StringSlice").msgclass 24 | HookType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coprocess.HookType").enummodule 25 | end 26 | -------------------------------------------------------------------------------- /bindings/ruby/coprocess_mini_request_object_pb.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: coprocess_mini_request_object.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require 'coprocess_return_overrides_pb' 7 | Google::Protobuf::DescriptorPool.generated_pool.build do 8 | add_file("coprocess_mini_request_object.proto", :syntax => :proto3) do 9 | add_message "coprocess.MiniRequestObject" do 10 | map :headers, :string, :string, 1 11 | map :set_headers, :string, :string, 2 12 | repeated :delete_headers, :string, 3 13 | optional :body, :string, 4 14 | optional :url, :string, 5 15 | map :params, :string, :string, 6 16 | map :add_params, :string, :string, 7 17 | map :extended_params, :string, :string, 8 18 | repeated :delete_params, :string, 9 19 | optional :return_overrides, :message, 10, "coprocess.ReturnOverrides" 20 | optional :method, :string, 11 21 | optional :request_uri, :string, 12 22 | optional :scheme, :string, 13 23 | optional :raw_body, :bytes, 14 24 | end 25 | end 26 | end 27 | 28 | module Coprocess 29 | MiniRequestObject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coprocess.MiniRequestObject").msgclass 30 | end 31 | -------------------------------------------------------------------------------- /bindings/ruby/coprocess_object_pb.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: coprocess_object.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require 'coprocess_mini_request_object_pb' 7 | require 'coprocess_response_object_pb' 8 | require 'coprocess_session_state_pb' 9 | require 'coprocess_common_pb' 10 | Google::Protobuf::DescriptorPool.generated_pool.build do 11 | add_file("coprocess_object.proto", :syntax => :proto3) do 12 | add_message "coprocess.Object" do 13 | optional :hook_type, :enum, 1, "coprocess.HookType" 14 | optional :hook_name, :string, 2 15 | optional :request, :message, 3, "coprocess.MiniRequestObject" 16 | optional :session, :message, 4, "coprocess.SessionState" 17 | map :metadata, :string, :string, 5 18 | map :spec, :string, :string, 6 19 | optional :response, :message, 7, "coprocess.ResponseObject" 20 | end 21 | add_message "coprocess.Event" do 22 | optional :payload, :string, 1 23 | end 24 | add_message "coprocess.EventReply" do 25 | end 26 | end 27 | end 28 | 29 | module Coprocess 30 | Object = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coprocess.Object").msgclass 31 | Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coprocess.Event").msgclass 32 | EventReply = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coprocess.EventReply").msgclass 33 | end 34 | -------------------------------------------------------------------------------- /bindings/ruby/coprocess_response_object_pb.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: coprocess_response_object.proto 3 | 4 | require 'google/protobuf' 5 | 6 | require 'coprocess_return_overrides_pb' 7 | Google::Protobuf::DescriptorPool.generated_pool.build do 8 | add_file("coprocess_response_object.proto", :syntax => :proto3) do 9 | add_message "coprocess.ResponseObject" do 10 | optional :status_code, :int32, 1 11 | optional :raw_body, :bytes, 2 12 | optional :body, :string, 3 13 | map :headers, :string, :string, 4 14 | end 15 | end 16 | end 17 | 18 | module Coprocess 19 | ResponseObject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coprocess.ResponseObject").msgclass 20 | end 21 | -------------------------------------------------------------------------------- /bindings/ruby/coprocess_return_overrides_pb.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: coprocess_return_overrides.proto 3 | 4 | require 'google/protobuf' 5 | 6 | Google::Protobuf::DescriptorPool.generated_pool.build do 7 | add_file("coprocess_return_overrides.proto", :syntax => :proto3) do 8 | add_message "coprocess.ReturnOverrides" do 9 | optional :response_code, :int32, 1 10 | optional :response_error, :string, 2 11 | map :headers, :string, :string, 3 12 | optional :override_error, :bool, 4 13 | optional :response_body, :string, 5 14 | end 15 | end 16 | end 17 | 18 | module Coprocess 19 | ReturnOverrides = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coprocess.ReturnOverrides").msgclass 20 | end 21 | -------------------------------------------------------------------------------- /bindings/ruby/coprocess_session_state_pb.rb: -------------------------------------------------------------------------------- 1 | # Generated by the protocol buffer compiler. DO NOT EDIT! 2 | # source: coprocess_session_state.proto 3 | 4 | require 'google/protobuf' 5 | 6 | Google::Protobuf::DescriptorPool.generated_pool.build do 7 | add_file("coprocess_session_state.proto", :syntax => :proto3) do 8 | add_message "coprocess.AccessSpec" do 9 | optional :url, :string, 1 10 | repeated :methods, :string, 2 11 | end 12 | add_message "coprocess.AccessDefinition" do 13 | optional :api_name, :string, 1 14 | optional :api_id, :string, 2 15 | repeated :versions, :string, 3 16 | repeated :allowed_urls, :message, 4, "coprocess.AccessSpec" 17 | end 18 | add_message "coprocess.BasicAuthData" do 19 | optional :password, :string, 1 20 | optional :hash, :string, 2 21 | end 22 | add_message "coprocess.JWTData" do 23 | optional :secret, :string, 1 24 | end 25 | add_message "coprocess.Monitor" do 26 | repeated :trigger_limits, :double, 1 27 | end 28 | add_message "coprocess.SessionState" do 29 | optional :last_check, :int64, 1 30 | optional :allowance, :double, 2 31 | optional :rate, :double, 3 32 | optional :per, :double, 4 33 | optional :expires, :int64, 5 34 | optional :quota_max, :int64, 6 35 | optional :quota_renews, :int64, 7 36 | optional :quota_remaining, :int64, 8 37 | optional :quota_renewal_rate, :int64, 9 38 | map :access_rights, :string, :message, 10, "coprocess.AccessDefinition" 39 | optional :org_id, :string, 11 40 | optional :oauth_client_id, :string, 12 41 | map :oauth_keys, :string, :string, 13 42 | optional :basic_auth_data, :message, 14, "coprocess.BasicAuthData" 43 | optional :jwt_data, :message, 15, "coprocess.JWTData" 44 | optional :hmac_enabled, :bool, 16 45 | optional :hmac_secret, :string, 17 46 | optional :is_inactive, :bool, 18 47 | optional :apply_policy_id, :string, 19 48 | optional :data_expires, :int64, 20 49 | optional :monitor, :message, 21, "coprocess.Monitor" 50 | optional :enable_detailed_recording, :bool, 22 51 | map :metadata, :string, :string, 23 52 | repeated :tags, :string, 24 53 | optional :alias, :string, 25 54 | optional :last_updated, :string, 26 55 | optional :id_extractor_deadline, :int64, 27 56 | optional :session_lifetime, :int64, 28 57 | repeated :apply_policies, :string, 29 58 | optional :certificate, :string, 30 59 | optional :max_query_depth, :int64, 31 60 | end 61 | end 62 | end 63 | 64 | module Coprocess 65 | AccessSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coprocess.AccessSpec").msgclass 66 | AccessDefinition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coprocess.AccessDefinition").msgclass 67 | BasicAuthData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coprocess.BasicAuthData").msgclass 68 | JWTData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coprocess.JWTData").msgclass 69 | Monitor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coprocess.Monitor").msgclass 70 | SessionState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("coprocess.SessionState").msgclass 71 | end 72 | -------------------------------------------------------------------------------- /bindings/ruby/dispatcher.rb: -------------------------------------------------------------------------------- 1 | this_dir = File.expand_path(File.dirname(__FILE__)) 2 | lib_dir = File.join(this_dir, 'lib') 3 | $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir) 4 | 5 | require 'grpc' 6 | 7 | require File.join(this_dir, 'coprocess_object_pb') 8 | # require File.join(this_dir, 'coprocess_return_overrides_pb' ) 9 | # require File.join(this_dir, 'coprocess_mini_request_object_pb') 10 | 11 | module Coprocess 12 | module Dispatcher 13 | class Service 14 | 15 | include GRPC::GenericService 16 | 17 | self.marshal_class_method = :encode 18 | self.unmarshal_class_method = :decode 19 | self.service_name = 'coprocess.Dispatcher' 20 | 21 | rpc :Dispatch, Coprocess::Object, Coprocess::Object 22 | rpc :DispatchEvent, Coprocess::Event, Coprocess::EventReply 23 | end 24 | 25 | Stub = Service.rpc_stub_class 26 | 27 | class HookNotImplemented < Exception 28 | end 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /coprocess_common.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // source: coprocess_common.proto 3 | 4 | package coprocess 5 | 6 | import ( 7 | fmt "fmt" 8 | math "math" 9 | 10 | proto "github.com/golang/protobuf/proto" 11 | ) 12 | 13 | // Reference imports to suppress errors if they are not otherwise used. 14 | var _ = proto.Marshal 15 | var _ = fmt.Errorf 16 | var _ = math.Inf 17 | 18 | // This is a compile-time assertion to ensure that this generated file 19 | // is compatible with the proto package it is being compiled against. 20 | // A compilation error at this line likely means your copy of the 21 | // proto package needs to be updated. 22 | const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 23 | 24 | type HookType int32 25 | 26 | const ( 27 | HookType_Unknown HookType = 0 28 | HookType_Pre HookType = 1 29 | HookType_Post HookType = 2 30 | HookType_PostKeyAuth HookType = 3 31 | HookType_CustomKeyCheck HookType = 4 32 | HookType_Response HookType = 5 33 | ) 34 | 35 | var HookType_name = map[int32]string{ 36 | 0: "Unknown", 37 | 1: "Pre", 38 | 2: "Post", 39 | 3: "PostKeyAuth", 40 | 4: "CustomKeyCheck", 41 | 5: "Response", 42 | } 43 | 44 | var HookType_value = map[string]int32{ 45 | "Unknown": 0, 46 | "Pre": 1, 47 | "Post": 2, 48 | "PostKeyAuth": 3, 49 | "CustomKeyCheck": 4, 50 | "Response": 5, 51 | } 52 | 53 | func (x HookType) String() string { 54 | return proto.EnumName(HookType_name, int32(x)) 55 | } 56 | 57 | func (HookType) EnumDescriptor() ([]byte, []int) { 58 | return fileDescriptor_ad9b17a8ddc1be7d, []int{0} 59 | } 60 | 61 | type StringSlice struct { 62 | Items []string `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` 63 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 64 | XXX_unrecognized []byte `json:"-"` 65 | XXX_sizecache int32 `json:"-"` 66 | } 67 | 68 | func (m *StringSlice) Reset() { *m = StringSlice{} } 69 | func (m *StringSlice) String() string { return proto.CompactTextString(m) } 70 | func (*StringSlice) ProtoMessage() {} 71 | func (*StringSlice) Descriptor() ([]byte, []int) { 72 | return fileDescriptor_ad9b17a8ddc1be7d, []int{0} 73 | } 74 | 75 | func (m *StringSlice) XXX_Unmarshal(b []byte) error { 76 | return xxx_messageInfo_StringSlice.Unmarshal(m, b) 77 | } 78 | func (m *StringSlice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 79 | return xxx_messageInfo_StringSlice.Marshal(b, m, deterministic) 80 | } 81 | func (m *StringSlice) XXX_Merge(src proto.Message) { 82 | xxx_messageInfo_StringSlice.Merge(m, src) 83 | } 84 | func (m *StringSlice) XXX_Size() int { 85 | return xxx_messageInfo_StringSlice.Size(m) 86 | } 87 | func (m *StringSlice) XXX_DiscardUnknown() { 88 | xxx_messageInfo_StringSlice.DiscardUnknown(m) 89 | } 90 | 91 | var xxx_messageInfo_StringSlice proto.InternalMessageInfo 92 | 93 | func (m *StringSlice) GetItems() []string { 94 | if m != nil { 95 | return m.Items 96 | } 97 | return nil 98 | } 99 | 100 | func init() { 101 | proto.RegisterEnum("coprocess.HookType", HookType_name, HookType_value) 102 | proto.RegisterType((*StringSlice)(nil), "coprocess.StringSlice") 103 | } 104 | 105 | func init() { proto.RegisterFile("coprocess_common.proto", fileDescriptor_ad9b17a8ddc1be7d) } 106 | 107 | var fileDescriptor_ad9b17a8ddc1be7d = []byte{ 108 | // 180 bytes of a gzipped FileDescriptorProto 109 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x8e, 0xb1, 0x8a, 0xc2, 0x40, 110 | 0x10, 0x40, 0x2f, 0x97, 0xe4, 0x92, 0x4c, 0x8e, 0xbb, 0x65, 0x10, 0xb1, 0x14, 0x6d, 0xc4, 0xc2, 111 | 0xc6, 0x2f, 0x90, 0x34, 0x42, 0x9a, 0x90, 0x68, 0x29, 0x82, 0xcb, 0x60, 0x42, 0xdc, 0x9d, 0x65, 112 | 0x77, 0x83, 0xe4, 0xef, 0x45, 0x05, 0xbb, 0xf7, 0x5e, 0xf5, 0x60, 0x2a, 0xd9, 0x58, 0x96, 0xe4, 113 | 0xdc, 0x59, 0xb2, 0x52, 0xac, 0x37, 0xc6, 0xb2, 0x67, 0xcc, 0x3e, 0x7d, 0xb1, 0x84, 0xbc, 0xf1, 114 | 0xb6, 0xd3, 0xd7, 0xe6, 0xd6, 0x49, 0xc2, 0x09, 0xc4, 0x9d, 0x27, 0xe5, 0x66, 0xc1, 0x3c, 0x5c, 115 | 0x65, 0xf5, 0x5b, 0xd6, 0x27, 0x48, 0xf7, 0xcc, 0xfd, 0x61, 0x34, 0x84, 0x39, 0x24, 0x47, 0xdd, 116 | 0x6b, 0xbe, 0x6b, 0xf1, 0x85, 0x09, 0x84, 0x95, 0x25, 0x11, 0x60, 0x0a, 0x51, 0xc5, 0xce, 0x8b, 117 | 0x6f, 0xfc, 0x87, 0xfc, 0x49, 0x25, 0x8d, 0xbb, 0xc1, 0xb7, 0x22, 0x44, 0x84, 0xbf, 0x62, 0x70, 118 | 0x9e, 0x55, 0x49, 0x63, 0xd1, 0x92, 0xec, 0x45, 0x84, 0xbf, 0x90, 0xd6, 0xe4, 0x0c, 0x6b, 0x47, 119 | 0x22, 0xbe, 0xfc, 0xbc, 0xae, 0xb6, 0x8f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc0, 0xab, 0xaa, 0xf6, 120 | 0xaf, 0x00, 0x00, 0x00, 121 | } 122 | -------------------------------------------------------------------------------- /coprocess_mini_request_object.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // source: coprocess_mini_request_object.proto 3 | 4 | package coprocess 5 | 6 | import ( 7 | fmt "fmt" 8 | math "math" 9 | 10 | proto "github.com/golang/protobuf/proto" 11 | ) 12 | 13 | // Reference imports to suppress errors if they are not otherwise used. 14 | var _ = proto.Marshal 15 | var _ = fmt.Errorf 16 | var _ = math.Inf 17 | 18 | // This is a compile-time assertion to ensure that this generated file 19 | // is compatible with the proto package it is being compiled against. 20 | // A compilation error at this line likely means your copy of the 21 | // proto package needs to be updated. 22 | const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 23 | 24 | type MiniRequestObject struct { 25 | Headers map[string]string `protobuf:"bytes,1,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 26 | SetHeaders map[string]string `protobuf:"bytes,2,rep,name=set_headers,json=setHeaders,proto3" json:"set_headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 27 | DeleteHeaders []string `protobuf:"bytes,3,rep,name=delete_headers,json=deleteHeaders,proto3" json:"delete_headers,omitempty"` 28 | Body string `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"` 29 | Url string `protobuf:"bytes,5,opt,name=url,proto3" json:"url,omitempty"` 30 | Params map[string]string `protobuf:"bytes,6,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 31 | AddParams map[string]string `protobuf:"bytes,7,rep,name=add_params,json=addParams,proto3" json:"add_params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 32 | ExtendedParams map[string]string `protobuf:"bytes,8,rep,name=extended_params,json=extendedParams,proto3" json:"extended_params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 33 | DeleteParams []string `protobuf:"bytes,9,rep,name=delete_params,json=deleteParams,proto3" json:"delete_params,omitempty"` 34 | ReturnOverrides *ReturnOverrides `protobuf:"bytes,10,opt,name=return_overrides,json=returnOverrides,proto3" json:"return_overrides,omitempty"` 35 | Method string `protobuf:"bytes,11,opt,name=method,proto3" json:"method,omitempty"` 36 | RequestUri string `protobuf:"bytes,12,opt,name=request_uri,json=requestUri,proto3" json:"request_uri,omitempty"` 37 | Scheme string `protobuf:"bytes,13,opt,name=scheme,proto3" json:"scheme,omitempty"` 38 | RawBody []byte `protobuf:"bytes,14,opt,name=raw_body,json=rawBody,proto3" json:"raw_body,omitempty"` 39 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 40 | XXX_unrecognized []byte `json:"-"` 41 | XXX_sizecache int32 `json:"-"` 42 | } 43 | 44 | func (m *MiniRequestObject) Reset() { *m = MiniRequestObject{} } 45 | func (m *MiniRequestObject) String() string { return proto.CompactTextString(m) } 46 | func (*MiniRequestObject) ProtoMessage() {} 47 | func (*MiniRequestObject) Descriptor() ([]byte, []int) { 48 | return fileDescriptor_7fc17e485a5ab6a4, []int{0} 49 | } 50 | 51 | func (m *MiniRequestObject) XXX_Unmarshal(b []byte) error { 52 | return xxx_messageInfo_MiniRequestObject.Unmarshal(m, b) 53 | } 54 | func (m *MiniRequestObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 55 | return xxx_messageInfo_MiniRequestObject.Marshal(b, m, deterministic) 56 | } 57 | func (m *MiniRequestObject) XXX_Merge(src proto.Message) { 58 | xxx_messageInfo_MiniRequestObject.Merge(m, src) 59 | } 60 | func (m *MiniRequestObject) XXX_Size() int { 61 | return xxx_messageInfo_MiniRequestObject.Size(m) 62 | } 63 | func (m *MiniRequestObject) XXX_DiscardUnknown() { 64 | xxx_messageInfo_MiniRequestObject.DiscardUnknown(m) 65 | } 66 | 67 | var xxx_messageInfo_MiniRequestObject proto.InternalMessageInfo 68 | 69 | func (m *MiniRequestObject) GetHeaders() map[string]string { 70 | if m != nil { 71 | return m.Headers 72 | } 73 | return nil 74 | } 75 | 76 | func (m *MiniRequestObject) GetSetHeaders() map[string]string { 77 | if m != nil { 78 | return m.SetHeaders 79 | } 80 | return nil 81 | } 82 | 83 | func (m *MiniRequestObject) GetDeleteHeaders() []string { 84 | if m != nil { 85 | return m.DeleteHeaders 86 | } 87 | return nil 88 | } 89 | 90 | func (m *MiniRequestObject) GetBody() string { 91 | if m != nil { 92 | return m.Body 93 | } 94 | return "" 95 | } 96 | 97 | func (m *MiniRequestObject) GetUrl() string { 98 | if m != nil { 99 | return m.Url 100 | } 101 | return "" 102 | } 103 | 104 | func (m *MiniRequestObject) GetParams() map[string]string { 105 | if m != nil { 106 | return m.Params 107 | } 108 | return nil 109 | } 110 | 111 | func (m *MiniRequestObject) GetAddParams() map[string]string { 112 | if m != nil { 113 | return m.AddParams 114 | } 115 | return nil 116 | } 117 | 118 | func (m *MiniRequestObject) GetExtendedParams() map[string]string { 119 | if m != nil { 120 | return m.ExtendedParams 121 | } 122 | return nil 123 | } 124 | 125 | func (m *MiniRequestObject) GetDeleteParams() []string { 126 | if m != nil { 127 | return m.DeleteParams 128 | } 129 | return nil 130 | } 131 | 132 | func (m *MiniRequestObject) GetReturnOverrides() *ReturnOverrides { 133 | if m != nil { 134 | return m.ReturnOverrides 135 | } 136 | return nil 137 | } 138 | 139 | func (m *MiniRequestObject) GetMethod() string { 140 | if m != nil { 141 | return m.Method 142 | } 143 | return "" 144 | } 145 | 146 | func (m *MiniRequestObject) GetRequestUri() string { 147 | if m != nil { 148 | return m.RequestUri 149 | } 150 | return "" 151 | } 152 | 153 | func (m *MiniRequestObject) GetScheme() string { 154 | if m != nil { 155 | return m.Scheme 156 | } 157 | return "" 158 | } 159 | 160 | func (m *MiniRequestObject) GetRawBody() []byte { 161 | if m != nil { 162 | return m.RawBody 163 | } 164 | return nil 165 | } 166 | 167 | func init() { 168 | proto.RegisterType((*MiniRequestObject)(nil), "coprocess.MiniRequestObject") 169 | proto.RegisterMapType((map[string]string)(nil), "coprocess.MiniRequestObject.AddParamsEntry") 170 | proto.RegisterMapType((map[string]string)(nil), "coprocess.MiniRequestObject.ExtendedParamsEntry") 171 | proto.RegisterMapType((map[string]string)(nil), "coprocess.MiniRequestObject.HeadersEntry") 172 | proto.RegisterMapType((map[string]string)(nil), "coprocess.MiniRequestObject.ParamsEntry") 173 | proto.RegisterMapType((map[string]string)(nil), "coprocess.MiniRequestObject.SetHeadersEntry") 174 | } 175 | 176 | func init() { 177 | proto.RegisterFile("coprocess_mini_request_object.proto", fileDescriptor_7fc17e485a5ab6a4) 178 | } 179 | 180 | var fileDescriptor_7fc17e485a5ab6a4 = []byte{ 181 | // 452 bytes of a gzipped FileDescriptorProto 182 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0xd1, 0x8b, 0xd3, 0x40, 183 | 0x10, 0xc6, 0x49, 0x7b, 0xd7, 0x5e, 0x26, 0xbd, 0xf6, 0x5c, 0x45, 0xd6, 0xbe, 0x18, 0x3c, 0x84, 184 | 0x88, 0x52, 0xe4, 0x7c, 0xd1, 0x43, 0xc1, 0x53, 0x0a, 0x22, 0x1c, 0x27, 0x11, 0x1f, 0x7c, 0x0a, 185 | 0xdb, 0xee, 0x40, 0xe3, 0xb5, 0xd9, 0x3a, 0xbb, 0xb9, 0x33, 0xff, 0xb3, 0x7f, 0x84, 0x74, 0x37, 186 | 0x89, 0xe9, 0x29, 0x81, 0xbc, 0xed, 0x7c, 0xf9, 0xbe, 0x1f, 0xc3, 0xcc, 0x04, 0x4e, 0x97, 0x6a, 187 | 0x4b, 0x6a, 0x89, 0x5a, 0x27, 0x9b, 0x34, 0x4b, 0x13, 0xc2, 0x9f, 0x39, 0x6a, 0x93, 0xa8, 0xc5, 188 | 0x0f, 0x5c, 0x9a, 0xd9, 0x96, 0x94, 0x51, 0xcc, 0xaf, 0x4d, 0xd3, 0xf0, 0xaf, 0x9f, 0xd0, 0xe4, 189 | 0x94, 0x25, 0xea, 0x06, 0x89, 0x52, 0x89, 0xda, 0x99, 0x9f, 0xfc, 0x1e, 0xc2, 0xbd, 0xcb, 0x34, 190 | 0x4b, 0x63, 0x47, 0xba, 0xb2, 0x20, 0xf6, 0x11, 0x86, 0x2b, 0x14, 0x12, 0x49, 0x73, 0x2f, 0xec, 191 | 0x47, 0xc1, 0xd9, 0xb3, 0x59, 0x4d, 0x9a, 0xfd, 0x63, 0x9f, 0x7d, 0x72, 0xde, 0x79, 0x66, 0xa8, 192 | 0x88, 0xab, 0x24, 0xbb, 0x84, 0x40, 0xa3, 0x49, 0x2a, 0x50, 0xcf, 0x82, 0x5e, 0xb4, 0x82, 0xbe, 193 | 0xa2, 0xd9, 0x63, 0x81, 0xae, 0x05, 0xf6, 0x14, 0xc6, 0x12, 0xd7, 0x68, 0xb0, 0x26, 0xf6, 0xc3, 194 | 0x7e, 0xe4, 0xc7, 0xc7, 0x4e, 0xad, 0x6c, 0x0c, 0x0e, 0x16, 0x4a, 0x16, 0xfc, 0x20, 0xf4, 0x22, 195 | 0x3f, 0xb6, 0x6f, 0x76, 0x02, 0xfd, 0x9c, 0xd6, 0xfc, 0xd0, 0x4a, 0xbb, 0x27, 0x7b, 0x0f, 0x83, 196 | 0xad, 0x20, 0xb1, 0xd1, 0x7c, 0x60, 0xdb, 0x8a, 0x5a, 0xdb, 0xfa, 0x62, 0xad, 0xae, 0xa5, 0x32, 197 | 0xc7, 0x3e, 0x03, 0x08, 0x29, 0x93, 0x92, 0x32, 0xb4, 0x94, 0xe7, 0xad, 0x94, 0x0b, 0x29, 0x9b, 198 | 0x20, 0x5f, 0x54, 0x35, 0xfb, 0x0e, 0x13, 0xfc, 0x65, 0x30, 0x93, 0x58, 0x03, 0x8f, 0x2c, 0xf0, 199 | 0x65, 0x2b, 0x70, 0x5e, 0x66, 0x9a, 0xd4, 0x31, 0xee, 0x89, 0xec, 0x14, 0xca, 0xf9, 0x54, 0x60, 200 | 0xdf, 0x0e, 0x6d, 0xe4, 0xc4, 0xd2, 0x34, 0x87, 0x93, 0xbb, 0xe7, 0xc1, 0x21, 0xf4, 0xa2, 0xe0, 201 | 0x6c, 0xda, 0x68, 0x20, 0xb6, 0x96, 0xab, 0xca, 0x11, 0x4f, 0x68, 0x5f, 0x60, 0x0f, 0x61, 0xb0, 202 | 0x41, 0xb3, 0x52, 0x92, 0x07, 0x76, 0xd2, 0x65, 0xc5, 0x1e, 0x43, 0x50, 0x1d, 0x6a, 0x4e, 0x29, 203 | 0x1f, 0xd9, 0x8f, 0x50, 0x4a, 0xdf, 0x28, 0xdd, 0x05, 0xf5, 0x72, 0x85, 0x1b, 0xe4, 0xc7, 0x2e, 204 | 0xe8, 0x2a, 0xf6, 0x08, 0x8e, 0x48, 0xdc, 0x26, 0x76, 0x9f, 0xe3, 0xd0, 0x8b, 0x46, 0xf1, 0x90, 205 | 0xc4, 0xed, 0x07, 0x25, 0x8b, 0xe9, 0x39, 0x8c, 0x9a, 0x97, 0xb2, 0x5b, 0xf1, 0x35, 0x16, 0xdc, 206 | 0x73, 0x2b, 0xbe, 0xc6, 0x82, 0x3d, 0x80, 0xc3, 0x1b, 0xb1, 0xce, 0x91, 0xf7, 0xac, 0xe6, 0x8a, 207 | 0xf3, 0xde, 0x6b, 0x6f, 0xfa, 0x0e, 0x26, 0x77, 0x0e, 0xad, 0x53, 0xfc, 0x0d, 0x04, 0x8d, 0x89, 208 | 0x77, 0x8a, 0xbe, 0x85, 0xf1, 0xfe, 0x15, 0x74, 0x4a, 0x5f, 0xc0, 0xfd, 0xff, 0xac, 0xbc, 0x0b, 209 | 0x62, 0x31, 0xb0, 0x7f, 0xfd, 0xab, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa0, 0xe0, 0x90, 0xb7, 210 | 0x49, 0x04, 0x00, 0x00, 211 | } 212 | -------------------------------------------------------------------------------- /coprocess_object.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // source: coprocess_object.proto 3 | 4 | package coprocess 5 | 6 | import ( 7 | context "context" 8 | fmt "fmt" 9 | math "math" 10 | 11 | proto "github.com/golang/protobuf/proto" 12 | grpc "google.golang.org/grpc" 13 | codes "google.golang.org/grpc/codes" 14 | status "google.golang.org/grpc/status" 15 | ) 16 | 17 | // Reference imports to suppress errors if they are not otherwise used. 18 | var _ = proto.Marshal 19 | var _ = fmt.Errorf 20 | var _ = math.Inf 21 | 22 | // This is a compile-time assertion to ensure that this generated file 23 | // is compatible with the proto package it is being compiled against. 24 | // A compilation error at this line likely means your copy of the 25 | // proto package needs to be updated. 26 | const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 27 | 28 | type Object struct { 29 | HookType HookType `protobuf:"varint,1,opt,name=hook_type,json=hookType,proto3,enum=coprocess.HookType" json:"hook_type,omitempty"` 30 | HookName string `protobuf:"bytes,2,opt,name=hook_name,json=hookName,proto3" json:"hook_name,omitempty"` 31 | Request *MiniRequestObject `protobuf:"bytes,3,opt,name=request,proto3" json:"request,omitempty"` 32 | Session *SessionState `protobuf:"bytes,4,opt,name=session,proto3" json:"session,omitempty"` 33 | Metadata map[string]string `protobuf:"bytes,5,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 34 | Spec map[string]string `protobuf:"bytes,6,rep,name=spec,proto3" json:"spec,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 35 | Response *ResponseObject `protobuf:"bytes,7,opt,name=response,proto3" json:"response,omitempty"` 36 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 37 | XXX_unrecognized []byte `json:"-"` 38 | XXX_sizecache int32 `json:"-"` 39 | } 40 | 41 | func (m *Object) Reset() { *m = Object{} } 42 | func (m *Object) String() string { return proto.CompactTextString(m) } 43 | func (*Object) ProtoMessage() {} 44 | func (*Object) Descriptor() ([]byte, []int) { 45 | return fileDescriptor_72698a2223f86099, []int{0} 46 | } 47 | 48 | func (m *Object) XXX_Unmarshal(b []byte) error { 49 | return xxx_messageInfo_Object.Unmarshal(m, b) 50 | } 51 | func (m *Object) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 52 | return xxx_messageInfo_Object.Marshal(b, m, deterministic) 53 | } 54 | func (m *Object) XXX_Merge(src proto.Message) { 55 | xxx_messageInfo_Object.Merge(m, src) 56 | } 57 | func (m *Object) XXX_Size() int { 58 | return xxx_messageInfo_Object.Size(m) 59 | } 60 | func (m *Object) XXX_DiscardUnknown() { 61 | xxx_messageInfo_Object.DiscardUnknown(m) 62 | } 63 | 64 | var xxx_messageInfo_Object proto.InternalMessageInfo 65 | 66 | func (m *Object) GetHookType() HookType { 67 | if m != nil { 68 | return m.HookType 69 | } 70 | return HookType_Unknown 71 | } 72 | 73 | func (m *Object) GetHookName() string { 74 | if m != nil { 75 | return m.HookName 76 | } 77 | return "" 78 | } 79 | 80 | func (m *Object) GetRequest() *MiniRequestObject { 81 | if m != nil { 82 | return m.Request 83 | } 84 | return nil 85 | } 86 | 87 | func (m *Object) GetSession() *SessionState { 88 | if m != nil { 89 | return m.Session 90 | } 91 | return nil 92 | } 93 | 94 | func (m *Object) GetMetadata() map[string]string { 95 | if m != nil { 96 | return m.Metadata 97 | } 98 | return nil 99 | } 100 | 101 | func (m *Object) GetSpec() map[string]string { 102 | if m != nil { 103 | return m.Spec 104 | } 105 | return nil 106 | } 107 | 108 | func (m *Object) GetResponse() *ResponseObject { 109 | if m != nil { 110 | return m.Response 111 | } 112 | return nil 113 | } 114 | 115 | type Event struct { 116 | Payload string `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` 117 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 118 | XXX_unrecognized []byte `json:"-"` 119 | XXX_sizecache int32 `json:"-"` 120 | } 121 | 122 | func (m *Event) Reset() { *m = Event{} } 123 | func (m *Event) String() string { return proto.CompactTextString(m) } 124 | func (*Event) ProtoMessage() {} 125 | func (*Event) Descriptor() ([]byte, []int) { 126 | return fileDescriptor_72698a2223f86099, []int{1} 127 | } 128 | 129 | func (m *Event) XXX_Unmarshal(b []byte) error { 130 | return xxx_messageInfo_Event.Unmarshal(m, b) 131 | } 132 | func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 133 | return xxx_messageInfo_Event.Marshal(b, m, deterministic) 134 | } 135 | func (m *Event) XXX_Merge(src proto.Message) { 136 | xxx_messageInfo_Event.Merge(m, src) 137 | } 138 | func (m *Event) XXX_Size() int { 139 | return xxx_messageInfo_Event.Size(m) 140 | } 141 | func (m *Event) XXX_DiscardUnknown() { 142 | xxx_messageInfo_Event.DiscardUnknown(m) 143 | } 144 | 145 | var xxx_messageInfo_Event proto.InternalMessageInfo 146 | 147 | func (m *Event) GetPayload() string { 148 | if m != nil { 149 | return m.Payload 150 | } 151 | return "" 152 | } 153 | 154 | type EventReply struct { 155 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 156 | XXX_unrecognized []byte `json:"-"` 157 | XXX_sizecache int32 `json:"-"` 158 | } 159 | 160 | func (m *EventReply) Reset() { *m = EventReply{} } 161 | func (m *EventReply) String() string { return proto.CompactTextString(m) } 162 | func (*EventReply) ProtoMessage() {} 163 | func (*EventReply) Descriptor() ([]byte, []int) { 164 | return fileDescriptor_72698a2223f86099, []int{2} 165 | } 166 | 167 | func (m *EventReply) XXX_Unmarshal(b []byte) error { 168 | return xxx_messageInfo_EventReply.Unmarshal(m, b) 169 | } 170 | func (m *EventReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 171 | return xxx_messageInfo_EventReply.Marshal(b, m, deterministic) 172 | } 173 | func (m *EventReply) XXX_Merge(src proto.Message) { 174 | xxx_messageInfo_EventReply.Merge(m, src) 175 | } 176 | func (m *EventReply) XXX_Size() int { 177 | return xxx_messageInfo_EventReply.Size(m) 178 | } 179 | func (m *EventReply) XXX_DiscardUnknown() { 180 | xxx_messageInfo_EventReply.DiscardUnknown(m) 181 | } 182 | 183 | var xxx_messageInfo_EventReply proto.InternalMessageInfo 184 | 185 | func init() { 186 | proto.RegisterType((*Object)(nil), "coprocess.Object") 187 | proto.RegisterMapType((map[string]string)(nil), "coprocess.Object.MetadataEntry") 188 | proto.RegisterMapType((map[string]string)(nil), "coprocess.Object.SpecEntry") 189 | proto.RegisterType((*Event)(nil), "coprocess.Event") 190 | proto.RegisterType((*EventReply)(nil), "coprocess.EventReply") 191 | } 192 | 193 | func init() { proto.RegisterFile("coprocess_object.proto", fileDescriptor_72698a2223f86099) } 194 | 195 | var fileDescriptor_72698a2223f86099 = []byte{ 196 | // 412 bytes of a gzipped FileDescriptorProto 197 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x4b, 0x6f, 0xd4, 0x30, 198 | 0x10, 0x80, 0x9b, 0x6e, 0x77, 0x37, 0x99, 0x52, 0x54, 0xcc, 0xcb, 0xa4, 0xa0, 0x86, 0x70, 0xc9, 199 | 0x29, 0x40, 0x10, 0x0f, 0xb5, 0x57, 0x2a, 0x71, 0x29, 0x48, 0x5e, 0xee, 0x91, 0x9b, 0x8e, 0xb4, 200 | 0x61, 0x37, 0xb6, 0x89, 0xdd, 0x4a, 0x91, 0xf8, 0xab, 0xfc, 0x17, 0x54, 0xdb, 0xc9, 0x66, 0xd9, 201 | 0x53, 0x6f, 0xf6, 0xcc, 0xf7, 0x79, 0x1e, 0x09, 0x3c, 0xab, 0xa4, 0x6a, 0x65, 0x85, 0x5a, 0x97, 202 | 0xf2, 0xea, 0x17, 0x56, 0x26, 0x57, 0xad, 0x34, 0x92, 0x44, 0x43, 0x3c, 0x7e, 0xb3, 0x41, 0x9a, 203 | 0x5a, 0xd4, 0x65, 0x8b, 0xbf, 0x6f, 0x50, 0x9b, 0x2d, 0x3e, 0x3e, 0xdd, 0x40, 0x2d, 0x6a, 0x25, 204 | 0x85, 0xc6, 0x6d, 0xe0, 0xd5, 0x06, 0xd0, 0xa8, 0x75, 0x2d, 0x45, 0xa9, 0x0d, 0x37, 0xe8, 0xd3, 205 | 0xa3, 0x3e, 0x2a, 0xd9, 0x34, 0x52, 0xb8, 0x78, 0xfa, 0x77, 0x02, 0xb3, 0x1f, 0xf6, 0x1d, 0xf2, 206 | 0x0e, 0xa2, 0xa5, 0x94, 0xab, 0xd2, 0x74, 0x0a, 0x69, 0x90, 0x04, 0xd9, 0xc3, 0xe2, 0x71, 0x3e, 207 | 0x68, 0xf9, 0x37, 0x29, 0x57, 0x3f, 0x3b, 0x85, 0x2c, 0x5c, 0xfa, 0x13, 0x39, 0xf1, 0x86, 0xe0, 208 | 0x0d, 0xd2, 0xfd, 0x24, 0xc8, 0x22, 0x97, 0xfc, 0xce, 0x1b, 0x24, 0x9f, 0x60, 0xee, 0x27, 0xa1, 209 | 0x93, 0x24, 0xc8, 0x0e, 0x8b, 0x97, 0xa3, 0xc7, 0x2e, 0x6b, 0x51, 0x33, 0x97, 0x75, 0xd5, 0x59, 210 | 0x0f, 0x93, 0xf7, 0x30, 0xf7, 0x03, 0xd0, 0x03, 0xeb, 0x3d, 0x1f, 0x79, 0x0b, 0x97, 0x59, 0xdc, 211 | 0x4d, 0xc6, 0x7a, 0x8e, 0x9c, 0x43, 0xd8, 0xa0, 0xe1, 0xd7, 0xdc, 0x70, 0x3a, 0x4d, 0x26, 0xd9, 212 | 0x61, 0x71, 0x3a, 0x72, 0x5c, 0x81, 0xfc, 0xd2, 0x13, 0x17, 0xc2, 0xb4, 0x1d, 0x1b, 0x04, 0xf2, 213 | 0x16, 0x0e, 0xb4, 0xc2, 0x8a, 0xce, 0xac, 0x78, 0xb2, 0x2b, 0x2e, 0x14, 0x56, 0x4e, 0xb2, 0x20, 214 | 0xf9, 0x08, 0x61, 0xff, 0x09, 0xe8, 0xdc, 0x76, 0xf8, 0x62, 0x24, 0x31, 0x9f, 0xf2, 0x63, 0x0d, 215 | 0x68, 0x7c, 0x0e, 0x47, 0x5b, 0x2d, 0x90, 0x63, 0x98, 0xac, 0xb0, 0xb3, 0x9b, 0x8e, 0xd8, 0xdd, 216 | 0x91, 0x3c, 0x81, 0xe9, 0x2d, 0x5f, 0xdf, 0xf4, 0xbb, 0x74, 0x97, 0xb3, 0xfd, 0x2f, 0x41, 0xfc, 217 | 0x19, 0xa2, 0xa1, 0x8d, 0xfb, 0x88, 0xe9, 0x6b, 0x98, 0x5e, 0xdc, 0xa2, 0x30, 0x84, 0xc2, 0x5c, 218 | 0xf1, 0x6e, 0x2d, 0xf9, 0xb5, 0x17, 0xfb, 0x6b, 0xfa, 0x00, 0xc0, 0x22, 0x0c, 0xd5, 0xba, 0x2b, 219 | 0xfe, 0x00, 0x7c, 0xad, 0xb5, 0xe2, 0xa6, 0x5a, 0x62, 0x4b, 0x0a, 0x08, 0xfb, 0x1b, 0x79, 0xb4, 220 | 0xb3, 0x9a, 0x78, 0x37, 0x94, 0xee, 0x91, 0x33, 0x38, 0xea, 0x1d, 0x57, 0xfa, 0x78, 0x44, 0xd9, 221 | 0x48, 0xfc, 0xf4, 0xff, 0x88, 0xad, 0x9d, 0xee, 0x5d, 0xcd, 0xec, 0x5f, 0xf9, 0xe1, 0x5f, 0x00, 222 | 0x00, 0x00, 0xff, 0xff, 0x99, 0x33, 0xf3, 0x0f, 0x37, 0x03, 0x00, 0x00, 223 | } 224 | 225 | // Reference imports to suppress errors if they are not otherwise used. 226 | var _ context.Context 227 | var _ grpc.ClientConnInterface 228 | 229 | // This is a compile-time assertion to ensure that this generated file 230 | // is compatible with the grpc package it is being compiled against. 231 | const _ = grpc.SupportPackageIsVersion6 232 | 233 | // DispatcherClient is the client API for Dispatcher service. 234 | // 235 | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 236 | type DispatcherClient interface { 237 | Dispatch(ctx context.Context, in *Object, opts ...grpc.CallOption) (*Object, error) 238 | DispatchEvent(ctx context.Context, in *Event, opts ...grpc.CallOption) (*EventReply, error) 239 | } 240 | 241 | type dispatcherClient struct { 242 | cc grpc.ClientConnInterface 243 | } 244 | 245 | func NewDispatcherClient(cc grpc.ClientConnInterface) DispatcherClient { 246 | return &dispatcherClient{cc} 247 | } 248 | 249 | func (c *dispatcherClient) Dispatch(ctx context.Context, in *Object, opts ...grpc.CallOption) (*Object, error) { 250 | out := new(Object) 251 | err := c.cc.Invoke(ctx, "/coprocess.Dispatcher/Dispatch", in, out, opts...) 252 | if err != nil { 253 | return nil, err 254 | } 255 | return out, nil 256 | } 257 | 258 | func (c *dispatcherClient) DispatchEvent(ctx context.Context, in *Event, opts ...grpc.CallOption) (*EventReply, error) { 259 | out := new(EventReply) 260 | err := c.cc.Invoke(ctx, "/coprocess.Dispatcher/DispatchEvent", in, out, opts...) 261 | if err != nil { 262 | return nil, err 263 | } 264 | return out, nil 265 | } 266 | 267 | // DispatcherServer is the server API for Dispatcher service. 268 | type DispatcherServer interface { 269 | Dispatch(context.Context, *Object) (*Object, error) 270 | DispatchEvent(context.Context, *Event) (*EventReply, error) 271 | } 272 | 273 | // UnimplementedDispatcherServer can be embedded to have forward compatible implementations. 274 | type UnimplementedDispatcherServer struct { 275 | } 276 | 277 | func (*UnimplementedDispatcherServer) Dispatch(ctx context.Context, req *Object) (*Object, error) { 278 | return nil, status.Errorf(codes.Unimplemented, "method Dispatch not implemented") 279 | } 280 | func (*UnimplementedDispatcherServer) DispatchEvent(ctx context.Context, req *Event) (*EventReply, error) { 281 | return nil, status.Errorf(codes.Unimplemented, "method DispatchEvent not implemented") 282 | } 283 | 284 | func RegisterDispatcherServer(s *grpc.Server, srv DispatcherServer) { 285 | s.RegisterService(&_Dispatcher_serviceDesc, srv) 286 | } 287 | 288 | func _Dispatcher_Dispatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 289 | in := new(Object) 290 | if err := dec(in); err != nil { 291 | return nil, err 292 | } 293 | if interceptor == nil { 294 | return srv.(DispatcherServer).Dispatch(ctx, in) 295 | } 296 | info := &grpc.UnaryServerInfo{ 297 | Server: srv, 298 | FullMethod: "/coprocess.Dispatcher/Dispatch", 299 | } 300 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 301 | return srv.(DispatcherServer).Dispatch(ctx, req.(*Object)) 302 | } 303 | return interceptor(ctx, in, info, handler) 304 | } 305 | 306 | func _Dispatcher_DispatchEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 307 | in := new(Event) 308 | if err := dec(in); err != nil { 309 | return nil, err 310 | } 311 | if interceptor == nil { 312 | return srv.(DispatcherServer).DispatchEvent(ctx, in) 313 | } 314 | info := &grpc.UnaryServerInfo{ 315 | Server: srv, 316 | FullMethod: "/coprocess.Dispatcher/DispatchEvent", 317 | } 318 | handler := func(ctx context.Context, req interface{}) (interface{}, error) { 319 | return srv.(DispatcherServer).DispatchEvent(ctx, req.(*Event)) 320 | } 321 | return interceptor(ctx, in, info, handler) 322 | } 323 | 324 | var _Dispatcher_serviceDesc = grpc.ServiceDesc{ 325 | ServiceName: "coprocess.Dispatcher", 326 | HandlerType: (*DispatcherServer)(nil), 327 | Methods: []grpc.MethodDesc{ 328 | { 329 | MethodName: "Dispatch", 330 | Handler: _Dispatcher_Dispatch_Handler, 331 | }, 332 | { 333 | MethodName: "DispatchEvent", 334 | Handler: _Dispatcher_DispatchEvent_Handler, 335 | }, 336 | }, 337 | Streams: []grpc.StreamDesc{}, 338 | Metadata: "coprocess_object.proto", 339 | } 340 | -------------------------------------------------------------------------------- /coprocess_response_object.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // source: coprocess_response_object.proto 3 | 4 | package coprocess 5 | 6 | import ( 7 | fmt "fmt" 8 | math "math" 9 | 10 | proto "github.com/golang/protobuf/proto" 11 | ) 12 | 13 | // Reference imports to suppress errors if they are not otherwise used. 14 | var _ = proto.Marshal 15 | var _ = fmt.Errorf 16 | var _ = math.Inf 17 | 18 | // This is a compile-time assertion to ensure that this generated file 19 | // is compatible with the proto package it is being compiled against. 20 | // A compilation error at this line likely means your copy of the 21 | // proto package needs to be updated. 22 | const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 23 | 24 | type ResponseObject struct { 25 | StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` 26 | RawBody []byte `protobuf:"bytes,2,opt,name=raw_body,json=rawBody,proto3" json:"raw_body,omitempty"` 27 | Body string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` 28 | Headers map[string]string `protobuf:"bytes,4,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 29 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 30 | XXX_unrecognized []byte `json:"-"` 31 | XXX_sizecache int32 `json:"-"` 32 | } 33 | 34 | func (m *ResponseObject) Reset() { *m = ResponseObject{} } 35 | func (m *ResponseObject) String() string { return proto.CompactTextString(m) } 36 | func (*ResponseObject) ProtoMessage() {} 37 | func (*ResponseObject) Descriptor() ([]byte, []int) { 38 | return fileDescriptor_95aa75cec67c3939, []int{0} 39 | } 40 | 41 | func (m *ResponseObject) XXX_Unmarshal(b []byte) error { 42 | return xxx_messageInfo_ResponseObject.Unmarshal(m, b) 43 | } 44 | func (m *ResponseObject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 45 | return xxx_messageInfo_ResponseObject.Marshal(b, m, deterministic) 46 | } 47 | func (m *ResponseObject) XXX_Merge(src proto.Message) { 48 | xxx_messageInfo_ResponseObject.Merge(m, src) 49 | } 50 | func (m *ResponseObject) XXX_Size() int { 51 | return xxx_messageInfo_ResponseObject.Size(m) 52 | } 53 | func (m *ResponseObject) XXX_DiscardUnknown() { 54 | xxx_messageInfo_ResponseObject.DiscardUnknown(m) 55 | } 56 | 57 | var xxx_messageInfo_ResponseObject proto.InternalMessageInfo 58 | 59 | func (m *ResponseObject) GetStatusCode() int32 { 60 | if m != nil { 61 | return m.StatusCode 62 | } 63 | return 0 64 | } 65 | 66 | func (m *ResponseObject) GetRawBody() []byte { 67 | if m != nil { 68 | return m.RawBody 69 | } 70 | return nil 71 | } 72 | 73 | func (m *ResponseObject) GetBody() string { 74 | if m != nil { 75 | return m.Body 76 | } 77 | return "" 78 | } 79 | 80 | func (m *ResponseObject) GetHeaders() map[string]string { 81 | if m != nil { 82 | return m.Headers 83 | } 84 | return nil 85 | } 86 | 87 | func init() { 88 | proto.RegisterType((*ResponseObject)(nil), "coprocess.ResponseObject") 89 | proto.RegisterMapType((map[string]string)(nil), "coprocess.ResponseObject.HeadersEntry") 90 | } 91 | 92 | func init() { proto.RegisterFile("coprocess_response_object.proto", fileDescriptor_95aa75cec67c3939) } 93 | 94 | var fileDescriptor_95aa75cec67c3939 = []byte{ 95 | // 237 bytes of a gzipped FileDescriptorProto 96 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x8f, 0x4f, 0x4b, 0xc3, 0x40, 97 | 0x10, 0xc5, 0xd9, 0xa6, 0xb5, 0x66, 0x5a, 0x44, 0x16, 0x0f, 0xb1, 0x97, 0x2e, 0x1e, 0x24, 0xa7, 98 | 0x1c, 0xf4, 0x22, 0x3d, 0x89, 0x22, 0x78, 0x13, 0xf6, 0x0b, 0x2c, 0x9b, 0xec, 0x80, 0xff, 0xc8, 99 | 0x84, 0x99, 0x4d, 0x4b, 0xbe, 0xac, 0x9f, 0x45, 0xdc, 0x68, 0x89, 0xb7, 0xb7, 0x6f, 0x7f, 0xf3, 100 | 0xe6, 0x0d, 0x6c, 0x1b, 0xea, 0x98, 0x1a, 0x14, 0x71, 0x8c, 0xd2, 0x51, 0x2b, 0xe8, 0xa8, 0x7e, 101 | 0xc7, 0x26, 0x56, 0x1d, 0x53, 0x24, 0x9d, 0x1f, 0x81, 0x8d, 0x99, 0xb2, 0xb1, 0xe7, 0xd6, 0xd1, 102 | 0x1e, 0x99, 0xdf, 0x02, 0xca, 0x08, 0x5f, 0x7d, 0x29, 0x38, 0xb3, 0xbf, 0x31, 0x2f, 0x29, 0x45, 103 | 0x6f, 0x61, 0x25, 0xd1, 0xc7, 0x5e, 0x5c, 0x43, 0x01, 0x0b, 0x65, 0x54, 0xb9, 0xb0, 0x30, 0x5a, 104 | 0x8f, 0x14, 0x50, 0x5f, 0xc2, 0x29, 0xfb, 0x83, 0xab, 0x29, 0x0c, 0xc5, 0xcc, 0xa8, 0x72, 0x6d, 105 | 0x97, 0xec, 0x0f, 0x0f, 0x14, 0x06, 0xad, 0x61, 0x9e, 0xec, 0xcc, 0xa8, 0x32, 0xb7, 0x49, 0xeb, 106 | 0x7b, 0x58, 0xbe, 0xa2, 0x0f, 0xc8, 0x52, 0xcc, 0x4d, 0x56, 0xae, 0x6e, 0xae, 0xab, 0x63, 0xad, 107 | 0xea, 0xff, 0xee, 0xea, 0x79, 0x04, 0x9f, 0xda, 0xc8, 0x83, 0xfd, 0x1b, 0xdb, 0xec, 0x60, 0x3d, 108 | 0xfd, 0xd0, 0xe7, 0x90, 0x7d, 0xe0, 0x90, 0x9a, 0xe5, 0xf6, 0x47, 0xea, 0x0b, 0x58, 0xec, 0xfd, 109 | 0x67, 0x8f, 0xa9, 0x4f, 0x6e, 0xc7, 0xc7, 0x6e, 0x76, 0xa7, 0xea, 0x93, 0x74, 0xe7, 0xed, 0x77, 110 | 0x00, 0x00, 0x00, 0xff, 0xff, 0x79, 0x37, 0x21, 0x1f, 0x37, 0x01, 0x00, 0x00, 111 | } 112 | -------------------------------------------------------------------------------- /coprocess_return_overrides.pb.go: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. DO NOT EDIT. 2 | // source: coprocess_return_overrides.proto 3 | 4 | package coprocess 5 | 6 | import ( 7 | fmt "fmt" 8 | math "math" 9 | 10 | proto "github.com/golang/protobuf/proto" 11 | ) 12 | 13 | // Reference imports to suppress errors if they are not otherwise used. 14 | var _ = proto.Marshal 15 | var _ = fmt.Errorf 16 | var _ = math.Inf 17 | 18 | // This is a compile-time assertion to ensure that this generated file 19 | // is compatible with the proto package it is being compiled against. 20 | // A compilation error at this line likely means your copy of the 21 | // proto package needs to be updated. 22 | const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 23 | 24 | type ReturnOverrides struct { 25 | ResponseCode int32 `protobuf:"varint,1,opt,name=response_code,json=responseCode,proto3" json:"response_code,omitempty"` 26 | ResponseError string `protobuf:"bytes,2,opt,name=response_error,json=responseError,proto3" json:"response_error,omitempty"` 27 | Headers map[string]string `protobuf:"bytes,3,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 28 | OverrideError bool `protobuf:"varint,4,opt,name=override_error,json=overrideError,proto3" json:"override_error,omitempty"` 29 | ResponseBody string `protobuf:"bytes,5,opt,name=response_body,json=responseBody,proto3" json:"response_body,omitempty"` 30 | XXX_NoUnkeyedLiteral struct{} `json:"-"` 31 | XXX_unrecognized []byte `json:"-"` 32 | XXX_sizecache int32 `json:"-"` 33 | } 34 | 35 | func (m *ReturnOverrides) Reset() { *m = ReturnOverrides{} } 36 | func (m *ReturnOverrides) String() string { return proto.CompactTextString(m) } 37 | func (*ReturnOverrides) ProtoMessage() {} 38 | func (*ReturnOverrides) Descriptor() ([]byte, []int) { 39 | return fileDescriptor_7c6abd8ea4a81548, []int{0} 40 | } 41 | 42 | func (m *ReturnOverrides) XXX_Unmarshal(b []byte) error { 43 | return xxx_messageInfo_ReturnOverrides.Unmarshal(m, b) 44 | } 45 | func (m *ReturnOverrides) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 46 | return xxx_messageInfo_ReturnOverrides.Marshal(b, m, deterministic) 47 | } 48 | func (m *ReturnOverrides) XXX_Merge(src proto.Message) { 49 | xxx_messageInfo_ReturnOverrides.Merge(m, src) 50 | } 51 | func (m *ReturnOverrides) XXX_Size() int { 52 | return xxx_messageInfo_ReturnOverrides.Size(m) 53 | } 54 | func (m *ReturnOverrides) XXX_DiscardUnknown() { 55 | xxx_messageInfo_ReturnOverrides.DiscardUnknown(m) 56 | } 57 | 58 | var xxx_messageInfo_ReturnOverrides proto.InternalMessageInfo 59 | 60 | func (m *ReturnOverrides) GetResponseCode() int32 { 61 | if m != nil { 62 | return m.ResponseCode 63 | } 64 | return 0 65 | } 66 | 67 | func (m *ReturnOverrides) GetResponseError() string { 68 | if m != nil { 69 | return m.ResponseError 70 | } 71 | return "" 72 | } 73 | 74 | func (m *ReturnOverrides) GetHeaders() map[string]string { 75 | if m != nil { 76 | return m.Headers 77 | } 78 | return nil 79 | } 80 | 81 | func (m *ReturnOverrides) GetOverrideError() bool { 82 | if m != nil { 83 | return m.OverrideError 84 | } 85 | return false 86 | } 87 | 88 | func (m *ReturnOverrides) GetResponseBody() string { 89 | if m != nil { 90 | return m.ResponseBody 91 | } 92 | return "" 93 | } 94 | 95 | func init() { 96 | proto.RegisterType((*ReturnOverrides)(nil), "coprocess.ReturnOverrides") 97 | proto.RegisterMapType((map[string]string)(nil), "coprocess.ReturnOverrides.HeadersEntry") 98 | } 99 | 100 | func init() { proto.RegisterFile("coprocess_return_overrides.proto", fileDescriptor_7c6abd8ea4a81548) } 101 | 102 | var fileDescriptor_7c6abd8ea4a81548 = []byte{ 103 | // 235 bytes of a gzipped FileDescriptorProto 104 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0xc1, 0x4a, 0xc4, 0x30, 105 | 0x10, 0x86, 0x49, 0x6b, 0xd5, 0x8e, 0xbb, 0x2a, 0xc1, 0x43, 0xf1, 0x14, 0x14, 0xb1, 0xa7, 0x1c, 106 | 0xf4, 0x22, 0x7b, 0x53, 0x59, 0xf0, 0x26, 0xe4, 0x05, 0xca, 0x6e, 0x33, 0xa0, 0x28, 0x9d, 0x32, 107 | 0xe9, 0x2e, 0xe4, 0x8d, 0x7c, 0x4c, 0x69, 0xba, 0x09, 0x65, 0x6f, 0xed, 0xcf, 0x37, 0x7c, 0xff, 108 | 0x1f, 0x50, 0x2d, 0xf5, 0x4c, 0x2d, 0x3a, 0xd7, 0x30, 0x0e, 0x3b, 0xee, 0x1a, 0xda, 0x23, 0xf3, 109 | 0xb7, 0x45, 0xa7, 0x7b, 0xa6, 0x81, 0x64, 0x99, 0x88, 0xbb, 0xbf, 0x0c, 0xae, 0x4c, 0xa0, 0x3e, 110 | 0x23, 0x24, 0xef, 0x61, 0xc9, 0xe8, 0x7a, 0xea, 0x1c, 0x36, 0x2d, 0x59, 0xac, 0x84, 0x12, 0x75, 111 | 0x61, 0x16, 0x31, 0x7c, 0x27, 0x8b, 0xf2, 0x01, 0x2e, 0x13, 0x84, 0xcc, 0xc4, 0x55, 0xa6, 0x44, 112 | 0x5d, 0x9a, 0x74, 0xba, 0x1e, 0x43, 0xf9, 0x0a, 0x67, 0x5f, 0xb8, 0xb1, 0xc8, 0xae, 0xca, 0x55, 113 | 0x5e, 0x5f, 0x3c, 0x3d, 0xea, 0x24, 0xd7, 0x47, 0x62, 0xfd, 0x31, 0x91, 0xeb, 0x6e, 0x60, 0x6f, 114 | 0xe2, 0xdd, 0x68, 0x8a, 0x03, 0x0e, 0xa6, 0x13, 0x25, 0xea, 0x73, 0xb3, 0x8c, 0xe9, 0x64, 0x9a, 115 | 0xb7, 0xde, 0x92, 0xf5, 0x55, 0x11, 0xfa, 0xa4, 0xd6, 0x6f, 0x64, 0xfd, 0xed, 0x0a, 0x16, 0x73, 116 | 0x89, 0xbc, 0x86, 0xfc, 0x07, 0x7d, 0x18, 0x58, 0x9a, 0xf1, 0x53, 0xde, 0x40, 0xb1, 0xdf, 0xfc, 117 | 0xee, 0xf0, 0x30, 0x67, 0xfa, 0x59, 0x65, 0x2f, 0x62, 0x7b, 0x1a, 0x1e, 0xef, 0xf9, 0x3f, 0x00, 118 | 0x00, 0xff, 0xff, 0x21, 0x7a, 0xdb, 0xef, 0x60, 0x01, 0x00, 0x00, 119 | } 120 | -------------------------------------------------------------------------------- /proto/codegen.py: -------------------------------------------------------------------------------- 1 | from grpc.tools import protoc 2 | 3 | protoc.main( 4 | ( 5 | '', 6 | '-I.', 7 | '--python_out=../bindings/python', 8 | '--grpc_python_out=../bindings/python', 9 | 'coprocess_object.proto', 10 | ) 11 | ) 12 | -------------------------------------------------------------------------------- /proto/coprocess_common.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package coprocess; 4 | 5 | enum HookType { 6 | Unknown = 0; 7 | Pre = 1; 8 | Post = 2; 9 | PostKeyAuth = 3; 10 | CustomKeyCheck = 4; 11 | Response = 5; 12 | } 13 | 14 | message StringSlice { 15 | repeated string items = 1; 16 | } 17 | -------------------------------------------------------------------------------- /proto/coprocess_mini_request_object.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "coprocess_return_overrides.proto"; 4 | // import "coprocess_common.proto"; 5 | 6 | package coprocess; 7 | 8 | message MiniRequestObject { 9 | map headers = 1; 10 | map set_headers = 2; 11 | repeated string delete_headers = 3; 12 | string body = 4; 13 | string url = 5; 14 | map params = 6; 15 | map add_params = 7; 16 | map extended_params = 8; 17 | repeated string delete_params = 9; 18 | ReturnOverrides return_overrides = 10; 19 | string method = 11; 20 | string request_uri = 12; 21 | string scheme = 13; 22 | bytes raw_body = 14; 23 | } 24 | -------------------------------------------------------------------------------- /proto/coprocess_object.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "coprocess_mini_request_object.proto"; 4 | import "coprocess_response_object.proto"; 5 | import "coprocess_session_state.proto"; 6 | import "coprocess_common.proto"; 7 | 8 | package coprocess; 9 | 10 | message Object { 11 | HookType hook_type = 1; 12 | string hook_name = 2; 13 | MiniRequestObject request = 3; 14 | SessionState session = 4; 15 | map metadata = 5; 16 | map spec = 6; 17 | ResponseObject response = 7; 18 | } 19 | 20 | message Event { 21 | string payload = 1; 22 | } 23 | 24 | message EventReply {} 25 | 26 | service Dispatcher { 27 | rpc Dispatch (Object) returns (Object) {} 28 | rpc DispatchEvent (Event) returns (EventReply) {} 29 | } 30 | -------------------------------------------------------------------------------- /proto/coprocess_response_object.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | import "coprocess_return_overrides.proto"; 4 | 5 | package coprocess; 6 | 7 | message ResponseObject { 8 | int32 status_code = 1; 9 | bytes raw_body = 2; 10 | string body = 3; 11 | map headers = 4; 12 | } 13 | -------------------------------------------------------------------------------- /proto/coprocess_return_overrides.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package coprocess; 4 | 5 | message ReturnOverrides { 6 | int32 response_code = 1; 7 | string response_error = 2; 8 | map headers = 3; 9 | bool override_error = 4; 10 | string response_body = 5; 11 | } 12 | -------------------------------------------------------------------------------- /proto/coprocess_session_state.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package coprocess; 4 | 5 | message AccessSpec { 6 | string url = 1; 7 | repeated string methods = 2; 8 | } 9 | 10 | message AccessDefinition { 11 | string api_name = 1; 12 | string api_id = 2; 13 | repeated string versions = 3; 14 | repeated AccessSpec allowed_urls = 4; 15 | } 16 | 17 | message BasicAuthData { 18 | string password = 1; 19 | string hash = 2; 20 | } 21 | 22 | message JWTData { 23 | string secret = 1; 24 | } 25 | 26 | message Monitor { 27 | repeated double trigger_limits = 1; 28 | } 29 | 30 | message SessionState { 31 | int64 last_check = 1; 32 | 33 | double allowance = 2; 34 | double rate = 3; 35 | double per = 4; 36 | 37 | int64 expires = 5; 38 | int64 quota_max = 6; 39 | int64 quota_renews = 7; 40 | int64 quota_remaining = 8; 41 | int64 quota_renewal_rate = 9; 42 | 43 | map access_rights = 10; 44 | 45 | string org_id = 11; 46 | string oauth_client_id = 12; 47 | map oauth_keys = 13; 48 | 49 | BasicAuthData basic_auth_data = 14; 50 | 51 | JWTData jwt_data = 15; 52 | 53 | bool hmac_enabled = 16; 54 | string hmac_secret = 17; 55 | bool is_inactive = 18; 56 | string apply_policy_id = 19; 57 | int64 data_expires = 20; 58 | 59 | Monitor monitor = 21; 60 | 61 | bool enable_detailed_recording = 22; 62 | 63 | map metadata = 23; 64 | 65 | repeated string tags = 24; 66 | string alias = 25; 67 | string last_updated = 26; 68 | 69 | int64 id_extractor_deadline = 27; 70 | int64 session_lifetime = 28; 71 | repeated string apply_policies = 29; 72 | 73 | string certificate = 30; 74 | 75 | int64 max_query_depth = 31; 76 | } 77 | -------------------------------------------------------------------------------- /proto/update_bindings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Dependencies needed: 4 | # * grpc (for protoc) 5 | # * go get -u github.com/golang/protobuf/protoc-gen-go 6 | # * pip3 install grpcio grpcio-tools 7 | 8 | echo "Generating bindings for Go." 9 | protoc -I. --go_out=plugins=grpc:../ *.proto 10 | 11 | echo "Generating bindings for Python." 12 | mkdir -p ../bindings/python 13 | protoc -I. --python_out=../bindings/python *.proto 14 | python3 codegen.py 15 | 16 | echo "Generating bindings for Ruby." 17 | mkdir -p ../bindings/ruby 18 | protoc -I. --ruby_out=plugins=grpc:../bindings/ruby *.proto 19 | 20 | cp ../bindings/python/* ../python/proto/ 21 | 22 | echo 23 | echo "Done" 24 | --------------------------------------------------------------------------------