mirror of
https://github.com/linka-cloud/grpc.git
synced 2024-11-05 02:36:24 +00:00
32 lines
717 B
Protocol Buffer
32 lines
717 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
package helloworld;
|
|
|
|
option go_package = "go.linka.cloud/grpc/example;main";
|
|
|
|
import "google/api/annotations.proto";
|
|
import "validate/validate.proto";
|
|
|
|
service Greeter {
|
|
rpc SayHello (HelloRequest) returns (HelloReply) {
|
|
option (google.api.http) = {
|
|
post: "/api/v1/greeter/hello"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc SayHelloStream (HelloStreamRequest) returns (stream HelloReply) {}
|
|
}
|
|
|
|
message HelloRequest {
|
|
string name = 1 [(validate.rules).string = {min_len: 2, max_len: 40}];
|
|
}
|
|
|
|
message HelloReply {
|
|
string message = 1;
|
|
}
|
|
|
|
message HelloStreamRequest {
|
|
string name = 1 [(validate.rules).string = {min_len: 2, max_len: 40}];
|
|
int64 count = 2;
|
|
}
|