I am new to gRPC and here is my problem. I am trying to write a service to expose myOwnServiceto 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 streamwork with io.Readerand io.Writerin my original service, so that the caller of the HighFivegRPC 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