Skip to content
Snippets Groups Projects
Commit 0e199026 authored by murgatroid99's avatar murgatroid99
Browse files

Updated ProtoBuf.js dependency. Updated protos to proto3

parent 90381019
No related branches found
No related tags found
No related merge requests found
...@@ -33,25 +33,25 @@ syntax = "proto3"; ...@@ -33,25 +33,25 @@ syntax = "proto3";
package math; package math;
message DivArgs { message DivArgs {
optional int64 dividend = 1; int64 dividend = 1;
optional int64 divisor = 2; int64 divisor = 2;
} }
message DivReply { message DivReply {
optional int64 quotient = 1; int64 quotient = 1;
optional int64 remainder = 2; int64 remainder = 2;
} }
message FibArgs { message FibArgs {
optional int64 limit = 1; int64 limit = 1;
} }
message Num { message Num {
optional int64 num = 1; int64 num = 1;
} }
message FibReply { message FibReply {
optional int64 count = 1; int64 count = 1;
} }
service Math { service Math {
......
...@@ -66,18 +66,18 @@ service RouteGuide { ...@@ -66,18 +66,18 @@ service RouteGuide {
// Latitudes should be in the range +/- 90 degrees and longitude should be in // Latitudes should be in the range +/- 90 degrees and longitude should be in
// the range +/- 180 degrees (inclusive). // the range +/- 180 degrees (inclusive).
message Point { message Point {
optional int32 latitude = 1; int32 latitude = 1;
optional int32 longitude = 2; int32 longitude = 2;
} }
// A latitude-longitude rectangle, represented as two diagonally opposite // A latitude-longitude rectangle, represented as two diagonally opposite
// points "lo" and "hi". // points "lo" and "hi".
message Rectangle { message Rectangle {
// One corner of the rectangle. // One corner of the rectangle.
optional Point lo = 1; Point lo = 1;
// The other corner of the rectangle. // The other corner of the rectangle.
optional Point hi = 2; Point hi = 2;
} }
// A feature names something at a given point. // A feature names something at a given point.
...@@ -85,19 +85,19 @@ message Rectangle { ...@@ -85,19 +85,19 @@ message Rectangle {
// If a feature could not be named, the name is empty. // If a feature could not be named, the name is empty.
message Feature { message Feature {
// The name of the feature. // The name of the feature.
optional string name = 1; string name = 1;
// The point where the feature is detected. // The point where the feature is detected.
optional Point location = 2; Point location = 2;
} }
// A RouteNote is a message sent while at a given point. // A RouteNote is a message sent while at a given point.
message RouteNote { message RouteNote {
// The location from which the message is sent. // The location from which the message is sent.
optional Point location = 1; Point location = 1;
// The message to be sent. // The message to be sent.
optional string message = 2; string message = 2;
} }
// A RouteSummary is received in response to a RecordRoute rpc. // A RouteSummary is received in response to a RecordRoute rpc.
...@@ -107,14 +107,14 @@ message RouteNote { ...@@ -107,14 +107,14 @@ message RouteNote {
// the distance between each point. // the distance between each point.
message RouteSummary { message RouteSummary {
// The number of points received. // The number of points received.
optional int32 point_count = 1; int32 point_count = 1;
// The number of known features passed while traversing the route. // The number of known features passed while traversing the route.
optional int32 feature_count = 2; int32 feature_count = 2;
// The distance covered in metres. // The distance covered in metres.
optional int32 distance = 3; int32 distance = 3;
// The duration of the traversal in seconds. // The duration of the traversal in seconds.
optional int32 elapsed_time = 4; int32 elapsed_time = 4;
} }
...@@ -33,13 +33,13 @@ package examples; ...@@ -33,13 +33,13 @@ package examples;
// Protocol type definitions // Protocol type definitions
message StockRequest { message StockRequest {
optional string symbol = 1; string symbol = 1;
optional int32 num_trades_to_watch = 2 [default=0]; int32 num_trades_to_watch = 2 [default=0];
} }
message StockReply { message StockReply {
optional float price = 1; float price = 1;
optional string symbol = 2; string symbol = 2;
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto2"; syntax = "proto3";
package grpc.testing; package grpc.testing;
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
// Message definitions to be used by integration test service definitions. // Message definitions to be used by integration test service definitions.
syntax = "proto2"; syntax = "proto3";
package grpc.testing; package grpc.testing;
...@@ -49,46 +49,46 @@ enum PayloadType { ...@@ -49,46 +49,46 @@ enum PayloadType {
// A block of data, to simply increase gRPC message size. // A block of data, to simply increase gRPC message size.
message Payload { message Payload {
// The type of data in body. // The type of data in body.
optional PayloadType type = 1 [default = COMPRESSABLE]; PayloadType type = 1;
// Primary contents of payload. // Primary contents of payload.
optional bytes body = 2; bytes body = 2;
} }
// Unary request. // Unary request.
message SimpleRequest { message SimpleRequest {
// Desired payload type in the response from the server. // Desired payload type in the response from the server.
// If response_type is RANDOM, server randomly chooses one from other formats. // If response_type is RANDOM, server randomly chooses one from other formats.
optional PayloadType response_type = 1 [default = COMPRESSABLE]; PayloadType response_type = 1;
// Desired payload size in the response from the server. // Desired payload size in the response from the server.
// If response_type is COMPRESSABLE, this denotes the size before compression. // If response_type is COMPRESSABLE, this denotes the size before compression.
optional int32 response_size = 2; int32 response_size = 2;
// Optional input payload sent along with the request. // Optional input payload sent along with the request.
optional Payload payload = 3; Payload payload = 3;
// Whether SimpleResponse should include username. // Whether SimpleResponse should include username.
optional bool fill_username = 4; bool fill_username = 4;
// Whether SimpleResponse should include OAuth scope. // Whether SimpleResponse should include OAuth scope.
optional bool fill_oauth_scope = 5; bool fill_oauth_scope = 5;
} }
// Unary response, as configured by the request. // Unary response, as configured by the request.
message SimpleResponse { message SimpleResponse {
// Payload to increase message size. // Payload to increase message size.
optional Payload payload = 1; Payload payload = 1;
// The user the request came from, for verifying authentication was // The user the request came from, for verifying authentication was
// successful when the client expected it. // successful when the client expected it.
optional string username = 2; string username = 2;
// OAuth scope. // OAuth scope.
optional string oauth_scope = 3; string oauth_scope = 3;
} }
// Client-streaming request. // Client-streaming request.
message StreamingInputCallRequest { message StreamingInputCallRequest {
// Optional input payload sent along with the request. // Optional input payload sent along with the request.
optional Payload payload = 1; Payload payload = 1;
// Not expecting any payload from the response. // Not expecting any payload from the response.
} }
...@@ -96,18 +96,18 @@ message StreamingInputCallRequest { ...@@ -96,18 +96,18 @@ message StreamingInputCallRequest {
// Client-streaming response. // Client-streaming response.
message StreamingInputCallResponse { message StreamingInputCallResponse {
// Aggregated size of payloads received from the client. // Aggregated size of payloads received from the client.
optional int32 aggregated_payload_size = 1; int32 aggregated_payload_size = 1;
} }
// Configuration for a particular response. // Configuration for a particular response.
message ResponseParameters { message ResponseParameters {
// Desired payload sizes in responses from the server. // Desired payload sizes in responses from the server.
// If response_type is COMPRESSABLE, this denotes the size before compression. // If response_type is COMPRESSABLE, this denotes the size before compression.
optional int32 size = 1; int32 size = 1;
// Desired interval between consecutive responses in the response stream in // Desired interval between consecutive responses in the response stream in
// microseconds. // microseconds.
optional int32 interval_us = 2; int32 interval_us = 2;
} }
// Server-streaming request. // Server-streaming request.
...@@ -116,17 +116,17 @@ message StreamingOutputCallRequest { ...@@ -116,17 +116,17 @@ message StreamingOutputCallRequest {
// If response_type is RANDOM, the payload from each response in the stream // 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 // might be of different types. This is to simulate a mixed type of payload
// stream. // stream.
optional PayloadType response_type = 1 [default = COMPRESSABLE]; PayloadType response_type = 1;
// Configuration for each expected response message. // Configuration for each expected response message.
repeated ResponseParameters response_parameters = 2; repeated ResponseParameters response_parameters = 2;
// Optional input payload sent along with the request. // Optional input payload sent along with the request.
optional Payload payload = 3; Payload payload = 3;
} }
// Server-streaming response, as configured by the request and parameters. // Server-streaming response, as configured by the request and parameters.
message StreamingOutputCallResponse { message StreamingOutputCallResponse {
// Payload to increase response size. // Payload to increase response size.
optional Payload payload = 1; Payload payload = 1;
} }
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
// An integration test service that covers all the method signature permutations // An integration test service that covers all the method signature permutations
// of unary/streaming requests/responses. // of unary/streaming requests/responses.
syntax = "proto2";
syntax = "proto3";
import "empty.proto"; import "empty.proto";
import "messages.proto"; import "messages.proto";
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
"dependencies": { "dependencies": {
"bindings": "^1.2.0", "bindings": "^1.2.0",
"nan": "^1.5.0", "nan": "^1.5.0",
"protobufjs": "^4.0.0-b2", "protobufjs": "dcodeIO/ProtoBuf.js",
"underscore": "^1.6.0", "underscore": "^1.6.0",
"underscore.string": "^3.0.0" "underscore.string": "^3.0.0"
}, },
......
...@@ -27,14 +27,14 @@ ...@@ -27,14 +27,14 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto2"; syntax = "proto3";
message Request { message Request {
optional bool error = 1; bool error = 1;
} }
message Response { message Response {
optional int32 count = 1; int32 count = 1;
} }
service TestService { service TestService {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment