Rename js-grpc folder, add enums to example file

This commit is contained in:
Mathieu Acthernoene 2017-01-06 11:38:48 +01:00
parent a8d641cd8d
commit ab2a5d5181
5 changed files with 18 additions and 2 deletions

View File

@ -9,7 +9,7 @@ install:
.PHONY: test .PHONY: test
test: build test: build
cd examples/dummy && make cd examples/dummy && make
cd examples/js-grpc && make cd examples/flow && make
.PHONY: docker.build .PHONY: docker.build
docker.build: docker.build:

View File

@ -3,7 +3,10 @@
import grpc from 'grpc' import grpc from 'grpc'
import pbFile from './pbFile.js' import pbFile from './pbFile.js'
type TestEnum =
| 'ELEMENT_A'
| 'ELEMENT_B'
;
type TestMessage = {| type TestMessage = {|
a?: string; a?: string;
@ -16,6 +19,10 @@ type TestMessage = {|
p?: Array<number>; p?: Array<number>;
q?: Array<number>; q?: Array<number>;
r?: Array<number>; r?: Array<number>;
s?:
| 'ELEMENT_C'
| 'ELEMENT_D'
;
|}; |};
type TestNoStreamRequest = {| type TestNoStreamRequest = {|

View File

@ -11,6 +11,11 @@ service TestService {
rpc TestStreamBoth(stream TestStreamBothRequest) returns (stream TestStreamBothReply); rpc TestStreamBoth(stream TestStreamBothRequest) returns (stream TestStreamBothReply);
} }
enum TestEnum {
ELEMENT_A = 0;
ELEMENT_B = 1;
}
message TestMessage { message TestMessage {
string a = 1; string a = 1;
int32 b = 2; int32 b = 2;
@ -22,6 +27,10 @@ message TestMessage {
repeated int64 p = 16; repeated int64 p = 16;
repeated float q = 17; repeated float q = 17;
repeated double r = 18; repeated double r = 18;
enum s {
ELEMENT_C = 0;
ELEMENT_D = 1;
}
} }
message TestNoStreamRequest { TestMessage message = 1; } message TestNoStreamRequest { TestMessage message = 1; }