mirror of https://github.com/grpc/grpc.git
Merge pull request #1162 from murgatroid99/php_add_protos
Replace generated code with proto files in PHP librarypull/1172/head
commit
c7439042b1
8 changed files with 327 additions and 1630 deletions
@ -1,479 +0,0 @@ |
||||
<?php |
||||
// DO NOT EDIT! Generated by Protobuf-PHP protoc plugin 1.0 |
||||
// Source: math.proto |
||||
// Date: 2014-11-14 00:00:41 |
||||
|
||||
namespace math { |
||||
|
||||
class DivArgs extends \DrSlump\Protobuf\Message { |
||||
|
||||
/** @var int */ |
||||
public $dividend = null; |
||||
|
||||
/** @var int */ |
||||
public $divisor = null; |
||||
|
||||
|
||||
/** @var \Closure[] */ |
||||
protected static $__extensions = array(); |
||||
|
||||
public static function descriptor() |
||||
{ |
||||
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'math.DivArgs'); |
||||
|
||||
// REQUIRED INT64 dividend = 1 |
||||
$f = new \DrSlump\Protobuf\Field(); |
||||
$f->number = 1; |
||||
$f->name = "dividend"; |
||||
$f->type = \DrSlump\Protobuf::TYPE_INT64; |
||||
$f->rule = \DrSlump\Protobuf::RULE_REQUIRED; |
||||
$descriptor->addField($f); |
||||
|
||||
// REQUIRED INT64 divisor = 2 |
||||
$f = new \DrSlump\Protobuf\Field(); |
||||
$f->number = 2; |
||||
$f->name = "divisor"; |
||||
$f->type = \DrSlump\Protobuf::TYPE_INT64; |
||||
$f->rule = \DrSlump\Protobuf::RULE_REQUIRED; |
||||
$descriptor->addField($f); |
||||
|
||||
foreach (self::$__extensions as $cb) { |
||||
$descriptor->addField($cb(), true); |
||||
} |
||||
|
||||
return $descriptor; |
||||
} |
||||
|
||||
/** |
||||
* Check if <dividend> has a value |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function hasDividend(){ |
||||
return $this->_has(1); |
||||
} |
||||
|
||||
/** |
||||
* Clear <dividend> value |
||||
* |
||||
* @return \math\DivArgs |
||||
*/ |
||||
public function clearDividend(){ |
||||
return $this->_clear(1); |
||||
} |
||||
|
||||
/** |
||||
* Get <dividend> value |
||||
* |
||||
* @return int |
||||
*/ |
||||
public function getDividend(){ |
||||
return $this->_get(1); |
||||
} |
||||
|
||||
/** |
||||
* Set <dividend> value |
||||
* |
||||
* @param int $value |
||||
* @return \math\DivArgs |
||||
*/ |
||||
public function setDividend( $value){ |
||||
return $this->_set(1, $value); |
||||
} |
||||
|
||||
/** |
||||
* Check if <divisor> has a value |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function hasDivisor(){ |
||||
return $this->_has(2); |
||||
} |
||||
|
||||
/** |
||||
* Clear <divisor> value |
||||
* |
||||
* @return \math\DivArgs |
||||
*/ |
||||
public function clearDivisor(){ |
||||
return $this->_clear(2); |
||||
} |
||||
|
||||
/** |
||||
* Get <divisor> value |
||||
* |
||||
* @return int |
||||
*/ |
||||
public function getDivisor(){ |
||||
return $this->_get(2); |
||||
} |
||||
|
||||
/** |
||||
* Set <divisor> value |
||||
* |
||||
* @param int $value |
||||
* @return \math\DivArgs |
||||
*/ |
||||
public function setDivisor( $value){ |
||||
return $this->_set(2, $value); |
||||
} |
||||
} |
||||
} |
||||
|
||||
namespace math { |
||||
|
||||
class DivReply extends \DrSlump\Protobuf\Message { |
||||
|
||||
/** @var int */ |
||||
public $quotient = null; |
||||
|
||||
/** @var int */ |
||||
public $remainder = null; |
||||
|
||||
|
||||
/** @var \Closure[] */ |
||||
protected static $__extensions = array(); |
||||
|
||||
public static function descriptor() |
||||
{ |
||||
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'math.DivReply'); |
||||
|
||||
// REQUIRED INT64 quotient = 1 |
||||
$f = new \DrSlump\Protobuf\Field(); |
||||
$f->number = 1; |
||||
$f->name = "quotient"; |
||||
$f->type = \DrSlump\Protobuf::TYPE_INT64; |
||||
$f->rule = \DrSlump\Protobuf::RULE_REQUIRED; |
||||
$descriptor->addField($f); |
||||
|
||||
// REQUIRED INT64 remainder = 2 |
||||
$f = new \DrSlump\Protobuf\Field(); |
||||
$f->number = 2; |
||||
$f->name = "remainder"; |
||||
$f->type = \DrSlump\Protobuf::TYPE_INT64; |
||||
$f->rule = \DrSlump\Protobuf::RULE_REQUIRED; |
||||
$descriptor->addField($f); |
||||
|
||||
foreach (self::$__extensions as $cb) { |
||||
$descriptor->addField($cb(), true); |
||||
} |
||||
|
||||
return $descriptor; |
||||
} |
||||
|
||||
/** |
||||
* Check if <quotient> has a value |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function hasQuotient(){ |
||||
return $this->_has(1); |
||||
} |
||||
|
||||
/** |
||||
* Clear <quotient> value |
||||
* |
||||
* @return \math\DivReply |
||||
*/ |
||||
public function clearQuotient(){ |
||||
return $this->_clear(1); |
||||
} |
||||
|
||||
/** |
||||
* Get <quotient> value |
||||
* |
||||
* @return int |
||||
*/ |
||||
public function getQuotient(){ |
||||
return $this->_get(1); |
||||
} |
||||
|
||||
/** |
||||
* Set <quotient> value |
||||
* |
||||
* @param int $value |
||||
* @return \math\DivReply |
||||
*/ |
||||
public function setQuotient( $value){ |
||||
return $this->_set(1, $value); |
||||
} |
||||
|
||||
/** |
||||
* Check if <remainder> has a value |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function hasRemainder(){ |
||||
return $this->_has(2); |
||||
} |
||||
|
||||
/** |
||||
* Clear <remainder> value |
||||
* |
||||
* @return \math\DivReply |
||||
*/ |
||||
public function clearRemainder(){ |
||||
return $this->_clear(2); |
||||
} |
||||
|
||||
/** |
||||
* Get <remainder> value |
||||
* |
||||
* @return int |
||||
*/ |
||||
public function getRemainder(){ |
||||
return $this->_get(2); |
||||
} |
||||
|
||||
/** |
||||
* Set <remainder> value |
||||
* |
||||
* @param int $value |
||||
* @return \math\DivReply |
||||
*/ |
||||
public function setRemainder( $value){ |
||||
return $this->_set(2, $value); |
||||
} |
||||
} |
||||
} |
||||
|
||||
namespace math { |
||||
|
||||
class FibArgs extends \DrSlump\Protobuf\Message { |
||||
|
||||
/** @var int */ |
||||
public $limit = null; |
||||
|
||||
|
||||
/** @var \Closure[] */ |
||||
protected static $__extensions = array(); |
||||
|
||||
public static function descriptor() |
||||
{ |
||||
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'math.FibArgs'); |
||||
|
||||
// OPTIONAL INT64 limit = 1 |
||||
$f = new \DrSlump\Protobuf\Field(); |
||||
$f->number = 1; |
||||
$f->name = "limit"; |
||||
$f->type = \DrSlump\Protobuf::TYPE_INT64; |
||||
$f->rule = \DrSlump\Protobuf::RULE_OPTIONAL; |
||||
$descriptor->addField($f); |
||||
|
||||
foreach (self::$__extensions as $cb) { |
||||
$descriptor->addField($cb(), true); |
||||
} |
||||
|
||||
return $descriptor; |
||||
} |
||||
|
||||
/** |
||||
* Check if <limit> has a value |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function hasLimit(){ |
||||
return $this->_has(1); |
||||
} |
||||
|
||||
/** |
||||
* Clear <limit> value |
||||
* |
||||
* @return \math\FibArgs |
||||
*/ |
||||
public function clearLimit(){ |
||||
return $this->_clear(1); |
||||
} |
||||
|
||||
/** |
||||
* Get <limit> value |
||||
* |
||||
* @return int |
||||
*/ |
||||
public function getLimit(){ |
||||
return $this->_get(1); |
||||
} |
||||
|
||||
/** |
||||
* Set <limit> value |
||||
* |
||||
* @param int $value |
||||
* @return \math\FibArgs |
||||
*/ |
||||
public function setLimit( $value){ |
||||
return $this->_set(1, $value); |
||||
} |
||||
} |
||||
} |
||||
|
||||
namespace math { |
||||
|
||||
class Num extends \DrSlump\Protobuf\Message { |
||||
|
||||
/** @var int */ |
||||
public $num = null; |
||||
|
||||
|
||||
/** @var \Closure[] */ |
||||
protected static $__extensions = array(); |
||||
|
||||
public static function descriptor() |
||||
{ |
||||
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'math.Num'); |
||||
|
||||
// REQUIRED INT64 num = 1 |
||||
$f = new \DrSlump\Protobuf\Field(); |
||||
$f->number = 1; |
||||
$f->name = "num"; |
||||
$f->type = \DrSlump\Protobuf::TYPE_INT64; |
||||
$f->rule = \DrSlump\Protobuf::RULE_REQUIRED; |
||||
$descriptor->addField($f); |
||||
|
||||
foreach (self::$__extensions as $cb) { |
||||
$descriptor->addField($cb(), true); |
||||
} |
||||
|
||||
return $descriptor; |
||||
} |
||||
|
||||
/** |
||||
* Check if <num> has a value |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function hasNum(){ |
||||
return $this->_has(1); |
||||
} |
||||
|
||||
/** |
||||
* Clear <num> value |
||||
* |
||||
* @return \math\Num |
||||
*/ |
||||
public function clearNum(){ |
||||
return $this->_clear(1); |
||||
} |
||||
|
||||
/** |
||||
* Get <num> value |
||||
* |
||||
* @return int |
||||
*/ |
||||
public function getNum(){ |
||||
return $this->_get(1); |
||||
} |
||||
|
||||
/** |
||||
* Set <num> value |
||||
* |
||||
* @param int $value |
||||
* @return \math\Num |
||||
*/ |
||||
public function setNum( $value){ |
||||
return $this->_set(1, $value); |
||||
} |
||||
} |
||||
} |
||||
|
||||
namespace math { |
||||
|
||||
class FibReply extends \DrSlump\Protobuf\Message { |
||||
|
||||
/** @var int */ |
||||
public $count = null; |
||||
|
||||
|
||||
/** @var \Closure[] */ |
||||
protected static $__extensions = array(); |
||||
|
||||
public static function descriptor() |
||||
{ |
||||
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'math.FibReply'); |
||||
|
||||
// REQUIRED INT64 count = 1 |
||||
$f = new \DrSlump\Protobuf\Field(); |
||||
$f->number = 1; |
||||
$f->name = "count"; |
||||
$f->type = \DrSlump\Protobuf::TYPE_INT64; |
||||
$f->rule = \DrSlump\Protobuf::RULE_REQUIRED; |
||||
$descriptor->addField($f); |
||||
|
||||
foreach (self::$__extensions as $cb) { |
||||
$descriptor->addField($cb(), true); |
||||
} |
||||
|
||||
return $descriptor; |
||||
} |
||||
|
||||
/** |
||||
* Check if <count> has a value |
||||
* |
||||
* @return boolean |
||||
*/ |
||||
public function hasCount(){ |
||||
return $this->_has(1); |
||||
} |
||||
|
||||
/** |
||||
* Clear <count> value |
||||
* |
||||
* @return \math\FibReply |
||||
*/ |
||||
public function clearCount(){ |
||||
return $this->_clear(1); |
||||
} |
||||
|
||||
/** |
||||
* Get <count> value |
||||
* |
||||
* @return int |
||||
*/ |
||||
public function getCount(){ |
||||
return $this->_get(1); |
||||
} |
||||
|
||||
/** |
||||
* Set <count> value |
||||
* |
||||
* @param int $value |
||||
* @return \math\FibReply |
||||
*/ |
||||
public function setCount( $value){ |
||||
return $this->_set(1, $value); |
||||
} |
||||
} |
||||
} |
||||
|
||||
namespace math { |
||||
|
||||
class MathClient extends \Grpc\BaseStub { |
||||
/** |
||||
* @param math\DivArgs $input |
||||
* @return math\DivReply |
||||
*/ |
||||
public function Div(\math\DivArgs $argument, $metadata = array()) { |
||||
return $this->_simpleRequest('/Math/Div', $argument, '\math\DivReply::deserialize', $metadata); |
||||
} |
||||
/** |
||||
* @param math\DivArgs $input |
||||
* @return math\DivReply |
||||
*/ |
||||
public function DivMany($metadata = array()) { |
||||
return $this->_bidiRequest('/Math/DivMany', '\math\DivReply::deserialize', $metadata); |
||||
} |
||||
/** |
||||
* @param math\FibArgs $input |
||||
* @return math\Num |
||||
*/ |
||||
public function Fib($argument, $metadata = array()) { |
||||
return $this->_serverStreamRequest('/Math/Fib', $argument, '\math\Num::deserialize', $metadata); |
||||
} |
||||
/** |
||||
* @param math\Num $input |
||||
* @return math\Num |
||||
*/ |
||||
public function Sum($arguments, $metadata = array()) { |
||||
return $this->_clientStreamRequest('/Math/Sum', $arguments, '\math\Num::deserialize', $metadata); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,80 @@ |
||||
|
||||
// Copyright 2015, Google Inc. |
||||
// All rights reserved. |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without |
||||
// modification, are permitted provided that the following conditions are |
||||
// met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright |
||||
// notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above |
||||
// copyright notice, this list of conditions and the following disclaimer |
||||
// in the documentation and/or other materials provided with the |
||||
// distribution. |
||||
// * Neither the name of Google Inc. nor the names of its |
||||
// contributors may be used to endorse or promote products derived from |
||||
// this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
syntax = "proto3"; |
||||
|
||||
package math; |
||||
|
||||
message DivArgs { |
||||
optional int64 dividend = 1; |
||||
optional int64 divisor = 2; |
||||
} |
||||
|
||||
message DivReply { |
||||
optional int64 quotient = 1; |
||||
optional int64 remainder = 2; |
||||
} |
||||
|
||||
message FibArgs { |
||||
optional int64 limit = 1; |
||||
} |
||||
|
||||
message Num { |
||||
optional int64 num = 1; |
||||
} |
||||
|
||||
message FibReply { |
||||
optional int64 count = 1; |
||||
} |
||||
|
||||
service Math { |
||||
// Div divides args.dividend by args.divisor and returns the quotient and |
||||
// remainder. |
||||
rpc Div (DivArgs) returns (DivReply) { |
||||
} |
||||
|
||||
// DivMany accepts an arbitrary number of division args from the client stream |
||||
// and sends back the results in the reply stream. The stream continues until |
||||
// the client closes its end; the server does the same after sending all the |
||||
// replies. The stream ends immediately if either end aborts. |
||||
rpc DivMany (stream DivArgs) returns (stream DivReply) { |
||||
} |
||||
|
||||
// Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib |
||||
// generates up to limit numbers; otherwise it continues until the call is |
||||
// canceled. Unlike Fib above, Fib has no final FibReply. |
||||
rpc Fib (FibArgs) returns (stream Num) { |
||||
} |
||||
|
||||
// Sum sums a stream of numbers, returning the final result once the stream |
||||
// is closed. |
||||
rpc Sum (stream Num) returns (Num) { |
||||
} |
||||
} |
@ -1,25 +0,0 @@ |
||||
<?php |
||||
// DO NOT EDIT! Generated by Protobuf-PHP protoc plugin 1.0 |
||||
// Source: test/cpp/interop/empty.proto |
||||
// Date: 2015-01-30 23:30:46 |
||||
|
||||
namespace grpc\testing { |
||||
|
||||
class EmptyMessage extends \DrSlump\Protobuf\Message { |
||||
|
||||
|
||||
/** @var \Closure[] */ |
||||
protected static $__extensions = array(); |
||||
|
||||
public static function descriptor() |
||||
{ |
||||
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'grpc.testing.EmptyMessage'); |
||||
|
||||
foreach (self::$__extensions as $cb) { |
||||
$descriptor->addField($cb(), true); |
||||
} |
||||
|
||||
return $descriptor; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,43 @@ |
||||
|
||||
// Copyright 2015, Google Inc. |
||||
// All rights reserved. |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without |
||||
// modification, are permitted provided that the following conditions are |
||||
// met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright |
||||
// notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above |
||||
// copyright notice, this list of conditions and the following disclaimer |
||||
// in the documentation and/or other materials provided with the |
||||
// distribution. |
||||
// * Neither the name of Google Inc. nor the names of its |
||||
// contributors may be used to endorse or promote products derived from |
||||
// this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
syntax = "proto2"; |
||||
|
||||
package grpc.testing; |
||||
|
||||
// An empty message that you can re-use to avoid defining duplicated empty |
||||
// messages in your project. A typical example is to use it as argument or the |
||||
// return value of a service API. For instance: |
||||
// |
||||
// service Foo { |
||||
// rpc Bar (grpc.testing.EmptyMessage) returns (grpc.testing.EmptyMessage) { }; |
||||
// }; |
||||
// |
||||
message EmptyMessage {} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,132 @@ |
||||
|
||||
// Copyright 2015, Google Inc. |
||||
// All rights reserved. |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without |
||||
// modification, are permitted provided that the following conditions are |
||||
// met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright |
||||
// notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above |
||||
// copyright notice, this list of conditions and the following disclaimer |
||||
// in the documentation and/or other materials provided with the |
||||
// distribution. |
||||
// * Neither the name of Google Inc. nor the names of its |
||||
// contributors may be used to endorse or promote products derived from |
||||
// this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
// Message definitions to be used by integration test service definitions. |
||||
|
||||
syntax = "proto2"; |
||||
|
||||
package grpc.testing; |
||||
|
||||
// The type of payload that should be returned. |
||||
enum PayloadType { |
||||
// Compressable text format. |
||||
COMPRESSABLE = 0; |
||||
|
||||
// Uncompressable binary format. |
||||
UNCOMPRESSABLE = 1; |
||||
|
||||
// Randomly chosen from all other formats defined in this enum. |
||||
RANDOM = 2; |
||||
} |
||||
|
||||
// A block of data, to simply increase gRPC message size. |
||||
message Payload { |
||||
// The type of data in body. |
||||
optional PayloadType type = 1 [default = COMPRESSABLE]; |
||||
// Primary contents of payload. |
||||
optional bytes body = 2; |
||||
} |
||||
|
||||
// Unary request. |
||||
message SimpleRequest { |
||||
// Desired payload type in the response from the server. |
||||
// If response_type is RANDOM, server randomly chooses one from other formats. |
||||
optional PayloadType response_type = 1 [default = COMPRESSABLE]; |
||||
|
||||
// Desired payload size in the response from the server. |
||||
// If response_type is COMPRESSABLE, this denotes the size before compression. |
||||
optional int32 response_size = 2; |
||||
|
||||
// Optional input payload sent along with the request. |
||||
optional Payload payload = 3; |
||||
|
||||
// Whether SimpleResponse should include username. |
||||
optional bool fill_username = 4; |
||||
|
||||
// Whether SimpleResponse should include OAuth scope. |
||||
optional bool fill_oauth_scope = 5; |
||||
} |
||||
|
||||
// Unary response, as configured by the request. |
||||
message SimpleResponse { |
||||
// Payload to increase message size. |
||||
optional Payload payload = 1; |
||||
// The user the request came from, for verifying authentication was |
||||
// successful when the client expected it. |
||||
optional string username = 2; |
||||
// OAuth scope. |
||||
optional string oauth_scope = 3; |
||||
} |
||||
|
||||
// Client-streaming request. |
||||
message StreamingInputCallRequest { |
||||
// Optional input payload sent along with the request. |
||||
optional Payload payload = 1; |
||||
|
||||
// Not expecting any payload from the response. |
||||
} |
||||
|
||||
// Client-streaming response. |
||||
message StreamingInputCallResponse { |
||||
// Aggregated size of payloads received from the client. |
||||
optional int32 aggregated_payload_size = 1; |
||||
} |
||||
|
||||
// Configuration for a particular response. |
||||
message ResponseParameters { |
||||
// Desired payload sizes in responses from the server. |
||||
// If response_type is COMPRESSABLE, this denotes the size before compression. |
||||
optional int32 size = 1; |
||||
|
||||
// Desired interval between consecutive responses in the response stream in |
||||
// microseconds. |
||||
optional int32 interval_us = 2; |
||||
} |
||||
|
||||
// Server-streaming request. |
||||
message StreamingOutputCallRequest { |
||||
// Desired payload type in the response from the server. |
||||
// If response_type is RANDOM, the payload from each response in the stream |
||||
// might be of different types. This is to simulate a mixed type of payload |
||||
// stream. |
||||
optional PayloadType response_type = 1 [default = COMPRESSABLE]; |
||||
|
||||
// Configuration for each expected response message. |
||||
repeated ResponseParameters response_parameters = 2; |
||||
|
||||
// Optional input payload sent along with the request. |
||||
optional Payload payload = 3; |
||||
} |
||||
|
||||
// Server-streaming response, as configured by the request and parameters. |
||||
message StreamingOutputCallResponse { |
||||
// Payload to increase response size. |
||||
optional Payload payload = 1; |
||||
} |
@ -1,52 +0,0 @@ |
||||
<?php |
||||
// DO NOT EDIT! Generated by Protobuf-PHP protoc plugin 1.0 |
||||
// Source: test/cpp/interop/test.proto |
||||
// Date: 2015-01-30 23:30:46 |
||||
|
||||
namespace grpc\testing { |
||||
|
||||
class TestServiceClient{ |
||||
|
||||
private $rpc_impl; |
||||
|
||||
public function __construct($rpc_impl) { |
||||
$this->rpc_impl = $rpc_impl; |
||||
} |
||||
/** |
||||
* @param grpc\testing\EmptyMessage $input |
||||
*/ |
||||
public function EmptyCall(\grpc\testing\EmptyMessage $argument, $metadata = array()) { |
||||
return $this->rpc_impl->_simpleRequest('/grpc.testing.TestService/EmptyCall', $argument, '\grpc\testing\EmptyMessage::deserialize', $metadata); |
||||
} |
||||
/** |
||||
* @param grpc\testing\SimpleRequest $input |
||||
*/ |
||||
public function UnaryCall(\grpc\testing\SimpleRequest $argument, $metadata = array()) { |
||||
return $this->rpc_impl->_simpleRequest('/grpc.testing.TestService/UnaryCall', $argument, '\grpc\testing\SimpleResponse::deserialize', $metadata); |
||||
} |
||||
/** |
||||
* @param grpc\testing\StreamingOutputCallRequest $input |
||||
*/ |
||||
public function StreamingOutputCall($argument, $metadata = array()) { |
||||
return $this->rpc_impl->_serverStreamRequest('/grpc.testing.TestService/StreamingOutputCall', $argument, '\grpc\testing\StreamingOutputCallResponse::deserialize', $metadata); |
||||
} |
||||
/** |
||||
* @param grpc\testing\StreamingInputCallRequest $input |
||||
*/ |
||||
public function StreamingInputCall($arguments, $metadata = array()) { |
||||
return $this->rpc_impl->_clientStreamRequest('/grpc.testing.TestService/StreamingInputCall', $arguments, '\grpc\testing\StreamingInputCallResponse::deserialize', $metadata); |
||||
} |
||||
/** |
||||
* @param grpc\testing\StreamingOutputCallRequest $input |
||||
*/ |
||||
public function FullDuplexCall($metadata = array()) { |
||||
return $this->rpc_impl->_bidiRequest('/grpc.testing.TestService/FullDuplexCall', '\grpc\testing\StreamingOutputCallResponse::deserialize', $metadata); |
||||
} |
||||
/** |
||||
* @param grpc\testing\StreamingOutputCallRequest $input |
||||
*/ |
||||
public function HalfDuplexCall($metadata = array()) { |
||||
return $this->rpc_impl->_bidiRequest('/grpc.testing.TestService/HalfDuplexCall', '\grpc\testing\StreamingOutputCallResponse::deserialize', $metadata); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,72 @@ |
||||
|
||||
// Copyright 2015, Google Inc. |
||||
// All rights reserved. |
||||
// |
||||
// Redistribution and use in source and binary forms, with or without |
||||
// modification, are permitted provided that the following conditions are |
||||
// met: |
||||
// |
||||
// * Redistributions of source code must retain the above copyright |
||||
// notice, this list of conditions and the following disclaimer. |
||||
// * Redistributions in binary form must reproduce the above |
||||
// copyright notice, this list of conditions and the following disclaimer |
||||
// in the documentation and/or other materials provided with the |
||||
// distribution. |
||||
// * Neither the name of Google Inc. nor the names of its |
||||
// contributors may be used to endorse or promote products derived from |
||||
// this software without specific prior written permission. |
||||
// |
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
// An integration test service that covers all the method signature permutations |
||||
// of unary/streaming requests/responses. |
||||
syntax = "proto2"; |
||||
|
||||
import "empty.proto"; |
||||
import "messages.proto"; |
||||
|
||||
package grpc.testing; |
||||
|
||||
// A simple service to test the various types of RPCs and experiment with |
||||
// performance with various types of payload. |
||||
service TestService { |
||||
// One empty request followed by one empty response. |
||||
rpc EmptyCall(grpc.testing.EmptyMessage) returns (grpc.testing.EmptyMessage); |
||||
|
||||
// One request followed by one response. |
||||
// TODO(Issue 527): Describe required server behavior. |
||||
rpc UnaryCall(SimpleRequest) returns (SimpleResponse); |
||||
|
||||
// One request followed by a sequence of responses (streamed download). |
||||
// The server returns the payload with client desired type and sizes. |
||||
rpc StreamingOutputCall(StreamingOutputCallRequest) |
||||
returns (stream StreamingOutputCallResponse); |
||||
|
||||
// A sequence of requests followed by one response (streamed upload). |
||||
// The server returns the aggregated size of client payload as the result. |
||||
rpc StreamingInputCall(stream StreamingInputCallRequest) |
||||
returns (StreamingInputCallResponse); |
||||
|
||||
// A sequence of requests with each request served by the server immediately. |
||||
// As one request could lead to multiple responses, this interface |
||||
// demonstrates the idea of full duplexing. |
||||
rpc FullDuplexCall(stream StreamingOutputCallRequest) |
||||
returns (stream StreamingOutputCallResponse); |
||||
|
||||
// A sequence of requests followed by a sequence of responses. |
||||
// The server buffers all the client requests and then serves them in order. A |
||||
// stream of responses are returned to the client when the server starts with |
||||
// first request. |
||||
rpc HalfDuplexCall(stream StreamingOutputCallRequest) |
||||
returns (stream StreamingOutputCallResponse); |
||||
} |
Loading…
Reference in new issue