2017-06-27 06:25:51 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
package echoserver;
|
|
|
|
|
|
|
|
import "google/api/annotations.proto";
|
|
|
|
|
|
|
|
message EchoRequest {
|
|
|
|
string message = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message EchoResponse {
|
|
|
|
string message = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Heartbeat {
|
|
|
|
enum Status {
|
|
|
|
UNKNOWN = 0;
|
|
|
|
OK = 1;
|
|
|
|
}
|
|
|
|
Status status = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Empty {}
|
|
|
|
|
|
|
|
service EchoService {
|
|
|
|
rpc Echo(stream EchoRequest) returns (stream EchoResponse) {
|
2017-06-27 06:56:50 +00:00
|
|
|
option (google.api.http) = {
|
|
|
|
post: "/echo"
|
|
|
|
body: "*"
|
|
|
|
};
|
2017-06-27 06:25:51 +00:00
|
|
|
}
|
|
|
|
rpc Stream(Empty) returns (stream EchoResponse) {
|
|
|
|
option (google.api.http) = {get: "/echo"};
|
|
|
|
}
|
|
|
|
rpc Heartbeats(stream Empty) returns (stream Heartbeat) {
|
|
|
|
option (google.api.http) = {post: "/heartbeats"};
|
|
|
|
}
|
|
|
|
}
|