grpc/example/example.proto

33 lines
833 B
Protocol Buffer
Raw Normal View History

2020-01-22 13:02:06 +00:00
syntax = "proto3";
package helloworld;
option go_package = "go.linka.cloud/grpc-toolkit/example;main";
import "google/api/annotations.proto";
import "validate/validate.proto";
import "defaults/defaults.proto";
2020-01-22 13:02:06 +00:00
service Greeter {
rpc SayHello (HelloRequest) returns (HelloReply) {
option (google.api.http) = {
post: "/api/v1/greeter/hello"
body: "*"
};
}
2020-01-22 13:02:06 +00:00
rpc SayHelloStream (HelloStreamRequest) returns (stream HelloReply) {}
}
message HelloRequest {
string name = 1 [(validate.rules).string = {min_len: 2, max_len: 40}];
2020-01-22 13:02:06 +00:00
}
message HelloReply {
string message = 1;
}
message HelloStreamRequest {
string name = 1 [(validate.rules).string = {min_len: 2, max_len: 40}];
int64 count = 2 [(validate.rules).int64 = {gte: 1, lte: 10}, (defaults.value).int64 = 10];
2020-01-22 13:02:06 +00:00
}