You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-zero/tools/goctl/rpc/generator/test.proto

62 lines
1.0 KiB
Protocol Buffer

// test proto
syntax = "proto3";
package test;
import "base/common.proto";
import "google/protobuf/any.proto";
option go_package = "github.com/test";
message Req {
string in = 1;
common.User user = 2;
google.protobuf.Any object = 4;
}
message Reply {
string out = 1;
}
message snake_req {}
message snake_reply {}
message CamelReq{}
message CamelReply{}
message EnumMessage {
enum Enum {
unknown = 0;
male = 1;
female = 2;
}
}
message CommonReply{}
message MapReq{
map<string, string> m = 1;
}
message RepeatedReq{
repeated string id = 1;
}
service Test_Service {
// service
rpc Service (Req) returns (Reply);
// greet service
rpc GreetService (Req) returns (Reply);
// case snake
rpc snake_service (snake_req) returns (snake_reply);
// case camel
rpc CamelService (CamelReq) returns (CamelReply);
// case enum
rpc EnumService (EnumMessage) returns (CommonReply);
// case map
rpc MapService (MapReq) returns (CommonReply);
// case repeated
rpc RepeatedService (RepeatedReq) returns (CommonReply);
}