go17/skills/grpc/service/hello.proto
2025-02-16 18:13:10 +08:00

34 lines
649 B
Protocol Buffer

syntax = "proto3";
package hello;
option go_package="gitlab.com/go-course-project/go17/skills/grpc/service";
message HelloRequest {
string my_name = 1;
int64 age = 2;
repeated int64 magic_number = 3;
map<string,string> extras = 4;
}
message HelloResponse {
string message = 1;
}
message ChatRequest {
uint64 id = 1;
string message = 2;
}
message ChatResponse {
uint64 id = 1;
bool is_success = 2;
string message = 3;
}
// grpc 接口声明
service HelloService {
rpc Hello(HelloRequest) returns(HelloResponse);
// 双向流接口
rpc Chat(stream ChatRequest) returns(stream ChatResponse);
}