I am new to gRPC and here is my problem. I am trying to write a service to expose myOwnService
to the gRPC service using the following service method:
rpc HighFive (stream HighRequest) returns (stream HighReply) {}
Server-side code is as follows:
func (s *server) HighFive(stream pb.Greeter_HighFiveServer) error {
myOwnService(stdin io.ReadCloser, stdout io.WriteCloser)
return nil
}
func myOwnService(stdin io.ReadCloser, stdout io.WriteCloser) error {
...
return nil
}
As you can see above, I have no idea how to stream
work with io.Reader
and io.Writer
in my original service, so that the caller of the HighFive
gRPC service can read and write data just as usual myOwnService
.
[Refresh] My current messages are similar to this, but you can change them if necessary:
message HighRequest {
bytes content = 1;
}
message HighReply {
bytes content = 1;
}
source
share