Skip to content

Commit

Permalink
Dedupe a_bit_of_everything.proto and streamless_everything.proto
Browse files Browse the repository at this point in the history
  • Loading branch information
yugui committed Jun 13, 2016
1 parent 90a540e commit 00ff8da
Show file tree
Hide file tree
Showing 14 changed files with 758 additions and 719 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ RUNTIME_GO=$(RUNTIME_PROTO:.proto=.pb.go)

PKGMAP=Mgoogle/protobuf/descriptor.proto=$(GO_PLUGIN_PKG)/descriptor,Mgoogle/api/annotations.proto=$(PKG)/$(GOOGLEAPIS_DIR)/google/api,Mexamples/sub/message.proto=$(PKG)/examples/sub
SWAGGER_EXAMPLES=examples/examplepb/echo_service.proto \
examples/examplepb/streamless_everything.proto
examples/examplepb/a_bit_of_everything.proto
EXAMPLES=examples/examplepb/echo_service.proto \
examples/examplepb/a_bit_of_everything.proto \
examples/examplepb/stream.proto \
examples/examplepb/flow_combination.proto
EXAMPLE_SVCSRCS=$(EXAMPLES:.proto=.pb.go)
EXAMPLE_GWSRCS=$(EXAMPLES:.proto=.pb.gw.go)
Expand Down
357 changes: 84 additions & 273 deletions examples/examplepb/a_bit_of_everything.pb.go

Large diffs are not rendered by default.

200 changes: 0 additions & 200 deletions examples/examplepb/a_bit_of_everything.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 9 additions & 18 deletions examples/examplepb/a_bit_of_everything.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ import "examples/sub2/message.proto";
// Intentionaly complicated message type to cover much features of Protobuf.
// NEXT ID: 27
message ABitOfEverything {
// Nested is nested type.
message Nested {
// name is nested field.
string name = 1;
uint32 amount = 2;
// DeepEnum is one or zero.
enum DeepEnum {
// FALSE is false.
FALSE = 0;
// TRUE is true.
TRUE = 1;
}
DeepEnum ok = 3;
Expand Down Expand Up @@ -54,9 +59,12 @@ message ABitOfEverything {
message EmptyMessage {
}

// NumericEnum is one or zero.
enum NumericEnum {
// ZERO means 0
ZERO = 0;
ONE = 1;
// ONE means 1
ONE = 1;
}

service ABitOfEverythingService {
Expand All @@ -72,22 +80,11 @@ service ABitOfEverythingService {
body: "*"
};
}
rpc BulkCreate(stream ABitOfEverything) returns (EmptyMessage) {
option (google.api.http) = {
post: "/v1/example/a_bit_of_everything/bulk"
body: "*"
};
}
rpc Lookup(sub2.IdMessage) returns (ABitOfEverything) {
option (google.api.http) = {
get: "/v1/example/a_bit_of_everything/{uuid}"
};
}
rpc List(EmptyMessage) returns (stream ABitOfEverything) {
option (google.api.http) = {
get: "/v1/example/a_bit_of_everything"
};
}
rpc Update(ABitOfEverything) returns (EmptyMessage) {
option (google.api.http) = {
put: "/v1/example/a_bit_of_everything/{uuid}"
Expand All @@ -111,12 +108,6 @@ service ABitOfEverythingService {
}
};
}
rpc BulkEcho(stream gengo.grpc.gateway.examples.sub.StringMessage) returns (stream gengo.grpc.gateway.examples.sub.StringMessage) {
option (google.api.http) = {
post: "/v1/example/a_bit_of_everything/echo"
body: "*"
};
}
rpc DeepPathEcho(ABitOfEverything) returns (ABitOfEverything) {
option (google.api.http) = {
post: "/v1/example/a_bit_of_everything/{single_nested.name}"
Expand Down
Loading

0 comments on commit 00ff8da

Please sign in to comment.