Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add dubbo3 demo #34

Closed
wants to merge 17 commits into from
619 changes: 619 additions & 0 deletions general/dubbo3/protobuf/dubbo3/helloworld.pb.go

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions general/dubbo3/protobuf/dubbo3/helloworld.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright 2015 The gRPC Authors
//
// Licensed 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";

option java_multiple_files = true;
option java_package = "org.apache.dubbo";
option java_outer_classname = "HelloWorldProto";
option objc_class_prefix = "HLW";

package protobuf;

// The greeting service definition.
service Dubbo3Greeter {
// Sends a greeting
rpc Dubbo3SayHello (stream Dubbo3HelloRequest) returns (stream Dubbo3HelloReply) {}
rpc Dubbo3SayHello2 ( Dubbo3HelloRequest) returns ( Dubbo3HelloReply) {}
rpc BigStreamTest (stream BigData) returns ( stream BigData){}
rpc BigUnaryTest (BigData) returns (BigData){}
}

// The request message containing the user's name.
message Dubbo3HelloRequest {
string myname = 1;
}

// The response message containing the greetings
message Dubbo3HelloReply {
string msg = 1;
}

message BigData {
bytes data = 1;
int32 wantSize = 2;
}
26 changes: 26 additions & 0 deletions general/dubbo3/protobuf/dubbo3/protobuf.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.PHONY: compile
PROTOC_GEN_GO := $(GOPATH)/bin/protoc-gen-go
PROTOC := $(shell which protoc)
ifeq ($(PROTOC),)
PROTOC = must-rebuild
endif

UNAME := $(shell uname)

$(PROTOC):
ifeq ($(UNAME), Darwin)
brew install protobuf
endif
ifeq ($(UNAME), Linux)
sudo apt-get install protobuf-compiler
endif

$(PROTOC_GEN_GO):
go get -u github.com/apache/dubbo-go/protocol/dubbo3/protoc-gen-dubbo3

helloworld.pb.go: helloworld.proto | $(PROTOC_GEN_GO) $(PROTOC)
protoc -I . helloworld.proto --dubbo3_out=plugins=grpc+dubbo:.

.PHONY: compile
compile: helloworld.pb.go

Loading