|
@@ -29,7 +29,7 @@ const (
|
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
|
type ServiceClient interface {
|
|
|
Download(ctx context.Context, in *DownloadRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Response], error)
|
|
|
- Upload(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[UploadRequest, Response], error)
|
|
|
+ Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*Response, error)
|
|
|
GetBidDetail(ctx context.Context, in *DownloadRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Response], error)
|
|
|
}
|
|
|
|
|
@@ -60,22 +60,19 @@ func (c *serviceClient) Download(ctx context.Context, in *DownloadRequest, opts
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
|
type Service_DownloadClient = grpc.ServerStreamingClient[Response]
|
|
|
|
|
|
-func (c *serviceClient) Upload(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[UploadRequest, Response], error) {
|
|
|
+func (c *serviceClient) Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*Response, error) {
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
|
- stream, err := c.cc.NewStream(ctx, &Service_ServiceDesc.Streams[1], Service_Upload_FullMethodName, cOpts...)
|
|
|
+ out := new(Response)
|
|
|
+ err := c.cc.Invoke(ctx, Service_Upload_FullMethodName, in, out, cOpts...)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
- x := &grpc.GenericClientStream[UploadRequest, Response]{ClientStream: stream}
|
|
|
- return x, nil
|
|
|
+ return out, nil
|
|
|
}
|
|
|
|
|
|
-// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
|
-type Service_UploadClient = grpc.ClientStreamingClient[UploadRequest, Response]
|
|
|
-
|
|
|
func (c *serviceClient) GetBidDetail(ctx context.Context, in *DownloadRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Response], error) {
|
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
|
- stream, err := c.cc.NewStream(ctx, &Service_ServiceDesc.Streams[2], Service_GetBidDetail_FullMethodName, cOpts...)
|
|
|
+ stream, err := c.cc.NewStream(ctx, &Service_ServiceDesc.Streams[1], Service_GetBidDetail_FullMethodName, cOpts...)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
@@ -97,7 +94,7 @@ type Service_GetBidDetailClient = grpc.ServerStreamingClient[Response]
|
|
|
// for forward compatibility.
|
|
|
type ServiceServer interface {
|
|
|
Download(*DownloadRequest, grpc.ServerStreamingServer[Response]) error
|
|
|
- Upload(grpc.ClientStreamingServer[UploadRequest, Response]) error
|
|
|
+ Upload(context.Context, *UploadRequest) (*Response, error)
|
|
|
GetBidDetail(*DownloadRequest, grpc.ServerStreamingServer[Response]) error
|
|
|
mustEmbedUnimplementedServiceServer()
|
|
|
}
|
|
@@ -112,8 +109,8 @@ type UnimplementedServiceServer struct{}
|
|
|
func (UnimplementedServiceServer) Download(*DownloadRequest, grpc.ServerStreamingServer[Response]) error {
|
|
|
return status.Errorf(codes.Unimplemented, "method Download not implemented")
|
|
|
}
|
|
|
-func (UnimplementedServiceServer) Upload(grpc.ClientStreamingServer[UploadRequest, Response]) error {
|
|
|
- return status.Errorf(codes.Unimplemented, "method Upload not implemented")
|
|
|
+func (UnimplementedServiceServer) Upload(context.Context, *UploadRequest) (*Response, error) {
|
|
|
+ return nil, status.Errorf(codes.Unimplemented, "method Upload not implemented")
|
|
|
}
|
|
|
func (UnimplementedServiceServer) GetBidDetail(*DownloadRequest, grpc.ServerStreamingServer[Response]) error {
|
|
|
return status.Errorf(codes.Unimplemented, "method GetBidDetail not implemented")
|
|
@@ -150,13 +147,24 @@ func _Service_Download_Handler(srv interface{}, stream grpc.ServerStream) error
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
|
type Service_DownloadServer = grpc.ServerStreamingServer[Response]
|
|
|
|
|
|
-func _Service_Upload_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
|
- return srv.(ServiceServer).Upload(&grpc.GenericServerStream[UploadRequest, Response]{ServerStream: stream})
|
|
|
+func _Service_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
|
+ in := new(UploadRequest)
|
|
|
+ if err := dec(in); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ if interceptor == nil {
|
|
|
+ return srv.(ServiceServer).Upload(ctx, in)
|
|
|
+ }
|
|
|
+ info := &grpc.UnaryServerInfo{
|
|
|
+ Server: srv,
|
|
|
+ FullMethod: Service_Upload_FullMethodName,
|
|
|
+ }
|
|
|
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
|
+ return srv.(ServiceServer).Upload(ctx, req.(*UploadRequest))
|
|
|
+ }
|
|
|
+ return interceptor(ctx, in, info, handler)
|
|
|
}
|
|
|
|
|
|
-// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
|
-type Service_UploadServer = grpc.ClientStreamingServer[UploadRequest, Response]
|
|
|
-
|
|
|
func _Service_GetBidDetail_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
|
m := new(DownloadRequest)
|
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
@@ -174,18 +182,18 @@ type Service_GetBidDetailServer = grpc.ServerStreamingServer[Response]
|
|
|
var Service_ServiceDesc = grpc.ServiceDesc{
|
|
|
ServiceName: "pb.Service",
|
|
|
HandlerType: (*ServiceServer)(nil),
|
|
|
- Methods: []grpc.MethodDesc{},
|
|
|
+ Methods: []grpc.MethodDesc{
|
|
|
+ {
|
|
|
+ MethodName: "Upload",
|
|
|
+ Handler: _Service_Upload_Handler,
|
|
|
+ },
|
|
|
+ },
|
|
|
Streams: []grpc.StreamDesc{
|
|
|
{
|
|
|
StreamName: "Download",
|
|
|
Handler: _Service_Download_Handler,
|
|
|
ServerStreams: true,
|
|
|
},
|
|
|
- {
|
|
|
- StreamName: "Upload",
|
|
|
- Handler: _Service_Upload_Handler,
|
|
|
- ClientStreams: true,
|
|
|
- },
|
|
|
{
|
|
|
StreamName: "GetBidDetail",
|
|
|
Handler: _Service_GetBidDetail_Handler,
|