...

Source file src/github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb/openapi_merge_b_grpc.pb.go

Documentation: github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  // versions:
     3  // - protoc-gen-go-grpc v1.2.0
     4  // - protoc             (unknown)
     5  // source: examples/internal/proto/examplepb/openapi_merge_b.proto
     6  
     7  package examplepb
     8  
     9  import (
    10  	context "context"
    11  	grpc "google.golang.org/grpc"
    12  	codes "google.golang.org/grpc/codes"
    13  	status "google.golang.org/grpc/status"
    14  )
    15  
    16  // This is a compile-time assertion to ensure that this generated file
    17  // is compatible with the grpc package it is being compiled against.
    18  // Requires gRPC-Go v1.32.0 or later.
    19  const _ = grpc.SupportPackageIsVersion7
    20  
    21  // ServiceBClient is the client API for ServiceB service.
    22  //
    23  // 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.
    24  type ServiceBClient interface {
    25  	// ServiceB.MethodOne receives InMessageB and returns OutMessageB
    26  	//
    27  	// Here is the detail explanation about ServiceB.MethodOne.
    28  	MethodOne(ctx context.Context, in *InMessageB, opts ...grpc.CallOption) (*OutMessageB, error)
    29  	// ServiceB.MethodTwo receives OutMessageB and returns InMessageB
    30  	//
    31  	// Here is the detail explanation about ServiceB.MethodTwo.
    32  	MethodTwo(ctx context.Context, in *OutMessageB, opts ...grpc.CallOption) (*InMessageB, error)
    33  }
    34  
    35  type serviceBClient struct {
    36  	cc grpc.ClientConnInterface
    37  }
    38  
    39  func NewServiceBClient(cc grpc.ClientConnInterface) ServiceBClient {
    40  	return &serviceBClient{cc}
    41  }
    42  
    43  func (c *serviceBClient) MethodOne(ctx context.Context, in *InMessageB, opts ...grpc.CallOption) (*OutMessageB, error) {
    44  	out := new(OutMessageB)
    45  	err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.examplepb.ServiceB/MethodOne", in, out, opts...)
    46  	if err != nil {
    47  		return nil, err
    48  	}
    49  	return out, nil
    50  }
    51  
    52  func (c *serviceBClient) MethodTwo(ctx context.Context, in *OutMessageB, opts ...grpc.CallOption) (*InMessageB, error) {
    53  	out := new(InMessageB)
    54  	err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.examplepb.ServiceB/MethodTwo", in, out, opts...)
    55  	if err != nil {
    56  		return nil, err
    57  	}
    58  	return out, nil
    59  }
    60  
    61  // ServiceBServer is the server API for ServiceB service.
    62  // All implementations should embed UnimplementedServiceBServer
    63  // for forward compatibility
    64  type ServiceBServer interface {
    65  	// ServiceB.MethodOne receives InMessageB and returns OutMessageB
    66  	//
    67  	// Here is the detail explanation about ServiceB.MethodOne.
    68  	MethodOne(context.Context, *InMessageB) (*OutMessageB, error)
    69  	// ServiceB.MethodTwo receives OutMessageB and returns InMessageB
    70  	//
    71  	// Here is the detail explanation about ServiceB.MethodTwo.
    72  	MethodTwo(context.Context, *OutMessageB) (*InMessageB, error)
    73  }
    74  
    75  // UnimplementedServiceBServer should be embedded to have forward compatible implementations.
    76  type UnimplementedServiceBServer struct {
    77  }
    78  
    79  func (UnimplementedServiceBServer) MethodOne(context.Context, *InMessageB) (*OutMessageB, error) {
    80  	return nil, status.Errorf(codes.Unimplemented, "method MethodOne not implemented")
    81  }
    82  func (UnimplementedServiceBServer) MethodTwo(context.Context, *OutMessageB) (*InMessageB, error) {
    83  	return nil, status.Errorf(codes.Unimplemented, "method MethodTwo not implemented")
    84  }
    85  
    86  // UnsafeServiceBServer may be embedded to opt out of forward compatibility for this service.
    87  // Use of this interface is not recommended, as added methods to ServiceBServer will
    88  // result in compilation errors.
    89  type UnsafeServiceBServer interface {
    90  	mustEmbedUnimplementedServiceBServer()
    91  }
    92  
    93  func RegisterServiceBServer(s grpc.ServiceRegistrar, srv ServiceBServer) {
    94  	s.RegisterService(&ServiceB_ServiceDesc, srv)
    95  }
    96  
    97  func _ServiceB_MethodOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    98  	in := new(InMessageB)
    99  	if err := dec(in); err != nil {
   100  		return nil, err
   101  	}
   102  	if interceptor == nil {
   103  		return srv.(ServiceBServer).MethodOne(ctx, in)
   104  	}
   105  	info := &grpc.UnaryServerInfo{
   106  		Server:     srv,
   107  		FullMethod: "/grpc.gateway.examples.internal.examplepb.ServiceB/MethodOne",
   108  	}
   109  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   110  		return srv.(ServiceBServer).MethodOne(ctx, req.(*InMessageB))
   111  	}
   112  	return interceptor(ctx, in, info, handler)
   113  }
   114  
   115  func _ServiceB_MethodTwo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   116  	in := new(OutMessageB)
   117  	if err := dec(in); err != nil {
   118  		return nil, err
   119  	}
   120  	if interceptor == nil {
   121  		return srv.(ServiceBServer).MethodTwo(ctx, in)
   122  	}
   123  	info := &grpc.UnaryServerInfo{
   124  		Server:     srv,
   125  		FullMethod: "/grpc.gateway.examples.internal.examplepb.ServiceB/MethodTwo",
   126  	}
   127  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   128  		return srv.(ServiceBServer).MethodTwo(ctx, req.(*OutMessageB))
   129  	}
   130  	return interceptor(ctx, in, info, handler)
   131  }
   132  
   133  // ServiceB_ServiceDesc is the grpc.ServiceDesc for ServiceB service.
   134  // It's only intended for direct use with grpc.RegisterService,
   135  // and not to be introspected or modified (even as a copy)
   136  var ServiceB_ServiceDesc = grpc.ServiceDesc{
   137  	ServiceName: "grpc.gateway.examples.internal.examplepb.ServiceB",
   138  	HandlerType: (*ServiceBServer)(nil),
   139  	Methods: []grpc.MethodDesc{
   140  		{
   141  			MethodName: "MethodOne",
   142  			Handler:    _ServiceB_MethodOne_Handler,
   143  		},
   144  		{
   145  			MethodName: "MethodTwo",
   146  			Handler:    _ServiceB_MethodTwo_Handler,
   147  		},
   148  	},
   149  	Streams:  []grpc.StreamDesc{},
   150  	Metadata: "examples/internal/proto/examplepb/openapi_merge_b.proto",
   151  }
   152  

View as plain text