frostfs-observability/tracing/grpc/server.go
Dmitrii Stepanov 7f9eba1b19 [#3] tracing: Move from api-go
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-05-31 11:27:42 +03:00

44 lines
942 B
Go

package grpc
import (
"context"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
)
type serverStream struct {
originalStream grpc.ServerStream
ctx context.Context // nolint:containedctx
}
func newgRPCServerStream(ctx context.Context, originalStream grpc.ServerStream) grpc.ServerStream {
return &serverStream{
originalStream: originalStream,
ctx: ctx,
}
}
func (ss *serverStream) SetHeader(md metadata.MD) error {
return ss.originalStream.SendHeader(md)
}
func (ss *serverStream) SendHeader(md metadata.MD) error {
return ss.originalStream.SendHeader(md)
}
func (ss *serverStream) SetTrailer(md metadata.MD) {
ss.originalStream.SetTrailer(md)
}
func (ss *serverStream) Context() context.Context {
return ss.ctx
}
func (ss *serverStream) SendMsg(m any) error {
return ss.originalStream.SendMsg(m)
}
func (ss *serverStream) RecvMsg(m any) error {
return ss.originalStream.RecvMsg(m)
}