1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-25 21:52:21 +00:00
2018-07-08 17:52:33 +08:00

30 lines
919 B
Protocol Buffer
Executable File

syntax = "proto3";
option go_package = "examplepb";
package grpc.gateway.examples.examplepb;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "examples/proto/examplepb/a_bit_of_everything.proto";
import "examples/proto/sub/message.proto";
// Defines some more operations to be added to ABitOfEverythingService
service StreamService {
rpc BulkCreate(stream ABitOfEverything) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/example/a_bit_of_everything/bulk"
body: "*"
};
}
rpc List(google.protobuf.Empty) returns (stream ABitOfEverything) {
option (google.api.http) = {
get: "/v1/example/a_bit_of_everything"
};
}
rpc BulkEcho(stream grpc.gateway.examples.sub.StringMessage) returns (stream grpc.gateway.examples.sub.StringMessage) {
option (google.api.http) = {
post: "/v1/example/a_bit_of_everything/echo"
body: "*"
};
}
}