micro-server-grpc/stream.go
Vasiliy Tolstov 6b5eb3555b fix import paths for v2 release
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-09-20 15:11:08 +03:00

39 lines
617 B
Go

package grpc
import (
"context"
"github.com/micro/go-micro/v2/server"
"google.golang.org/grpc"
)
// rpcStream implements a server side Stream.
type rpcStream struct {
s grpc.ServerStream
request server.Request
}
func (r *rpcStream) Close() error {
return nil
}
func (r *rpcStream) Error() error {
return nil
}
func (r *rpcStream) Request() server.Request {
return r.request
}
func (r *rpcStream) Context() context.Context {
return r.s.Context()
}
func (r *rpcStream) Send(m interface{}) error {
return r.s.SendMsg(m)
}
func (r *rpcStream) Recv(m interface{}) error {
return r.s.RecvMsg(m)
}