Skip to content

Commit

Permalink
support multi pb
Browse files Browse the repository at this point in the history
  • Loading branch information
xg.gao committed Aug 2, 2021
1 parent f76b01c commit cea0b8e
Show file tree
Hide file tree
Showing 9 changed files with 1,046 additions and 36 deletions.
1 change: 1 addition & 0 deletions protocol/grpc/internal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ This internal package is for test. So don't use internal in production.

- [helloworld](./helloworld): test unary process
- [routeguide](./routeguide): test stream process
- [multiprotos](./multiprotos): use multi pb to generate multi pb.go
19 changes: 9 additions & 10 deletions protocol/grpc/internal/helloworld/helloworld.pb.go

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

19 changes: 19 additions & 0 deletions protocol/grpc/internal/multiprotos/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

grpc-gen:
protoc -I ./ first.proto second.proto --go_out=plugins=grpc:.
dubbo-gen:
protoc -I ./ first.proto second.proto --dubbo_out=plugins=grpc+dubbo:.
307 changes: 307 additions & 0 deletions protocol/grpc/internal/multiprotos/first.pb.go

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

32 changes: 32 additions & 0 deletions protocol/grpc/internal/multiprotos/first.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

syntax = "proto3";

package multiprotos;

message FirstRequest {
string message = 1;
}

message FirstResponse {
string message = 1;
}

service FristService {
rpc Service (FirstRequest) returns (FirstResponse) {}
}
Loading

0 comments on commit cea0b8e

Please sign in to comment.