...

Source file src/github.com/grpc-ecosystem/grpc-gateway/v2/examples/internal/proto/examplepb/openapi_merge_a_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_a.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  // ServiceAClient is the client API for ServiceA 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 ServiceAClient interface {
    25  	// ServiceA.MethodOne receives InMessageA and returns OutMessageA
    26  	//
    27  	// Here is the detail explanation about ServiceA.MethodOne.
    28  	MethodOne(ctx context.Context, in *InMessageA, opts ...grpc.CallOption) (*OutMessageA, error)
    29  	// ServiceA.MethodTwo receives OutMessageA and returns InMessageA
    30  	//
    31  	// Here is the detail explanation about ServiceA.MethodTwo.
    32  	MethodTwo(ctx context.Context, in *OutMessageA, opts ...grpc.CallOption) (*InMessageA, error)
    33  }
    34  
    35  type serviceAClient struct {
    36  	cc grpc.ClientConnInterface
    37  }
    38  
    39  func NewServiceAClient(cc grpc.ClientConnInterface) ServiceAClient {
    40  	return &serviceAClient{cc}
    41  }
    42  
    43  func (c *serviceAClient) MethodOne(ctx context.Context, in *InMessageA, opts ...grpc.CallOption) (*OutMessageA, error) {
    44  	out := new(OutMessageA)
    45  	err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.examplepb.ServiceA/MethodOne", in, out, opts...)
    46  	if err != nil {
    47  		return nil, err
    48  	}
    49  	return out, nil
    50  }
    51  
    52  func (c *serviceAClient) MethodTwo(ctx context.Context, in *OutMessageA, opts ...grpc.CallOption) (*InMessageA, error) {
    53  	out := new(InMessageA)
    54  	err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.examplepb.ServiceA/MethodTwo", in, out, opts...)
    55  	if err != nil {
    56  		return nil, err
    57  	}
    58  	return out, nil
    59  }
    60  
    61  // ServiceAServer is the server API for ServiceA service.
    62  // All implementations should embed UnimplementedServiceAServer
    63  // for forward compatibility
    64  type ServiceAServer interface {
    65  	// ServiceA.MethodOne receives InMessageA and returns OutMessageA
    66  	//
    67  	// Here is the detail explanation about ServiceA.MethodOne.
    68  	MethodOne(context.Context, *InMessageA) (*OutMessageA, error)
    69  	// ServiceA.MethodTwo receives OutMessageA and returns InMessageA
    70  	//
    71  	// Here is the detail explanation about ServiceA.MethodTwo.
    72  	MethodTwo(context.Context, *OutMessageA) (*InMessageA, error)
    73  }
    74  
    75  // UnimplementedServiceAServer should be embedded to have forward compatible implementations.
    76  type UnimplementedServiceAServer struct {
    77  }
    78  
    79  func (UnimplementedServiceAServer) MethodOne(context.Context, *InMessageA) (*OutMessageA, error) {
    80  	return nil, status.Errorf(codes.Unimplemented, "method MethodOne not implemented")
    81  }
    82  func (UnimplementedServiceAServer) MethodTwo(context.Context, *OutMessageA) (*InMessageA, error) {
    83  	return nil, status.Errorf(codes.Unimplemented, "method MethodTwo not implemented")
    84  }
    85  
    86  // UnsafeServiceAServer may be embedded to opt out of forward compatibility for this service.
    87  // Use of this interface is not recommended, as added methods to ServiceAServer will
    88  // result in compilation errors.
    89  type UnsafeServiceAServer interface {
    90  	mustEmbedUnimplementedServiceAServer()
    91  }
    92  
    93  func RegisterServiceAServer(s grpc.ServiceRegistrar, srv ServiceAServer) {
    94  	s.RegisterService(&ServiceA_ServiceDesc, srv)
    95  }
    96  
    97  func _ServiceA_MethodOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    98  	in := new(InMessageA)
    99  	if err := dec(in); err != nil {
   100  		return nil, err
   101  	}
   102  	if interceptor == nil {
   103  		return srv.(ServiceAServer).MethodOne(ctx, in)
   104  	}
   105  	info := &grpc.UnaryServerInfo{
   106  		Server:     srv,
   107  		FullMethod: "/grpc.gateway.examples.internal.examplepb.ServiceA/MethodOne",
   108  	}
   109  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   110  		return srv.(ServiceAServer).MethodOne(ctx, req.(*InMessageA))
   111  	}
   112  	return interceptor(ctx, in, info, handler)
   113  }
   114  
   115  func _ServiceA_MethodTwo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   116  	in := new(OutMessageA)
   117  	if err := dec(in); err != nil {
   118  		return nil, err
   119  	}
   120  	if interceptor == nil {
   121  		return srv.(ServiceAServer).MethodTwo(ctx, in)
   122  	}
   123  	info := &grpc.UnaryServerInfo{
   124  		Server:     srv,
   125  		FullMethod: "/grpc.gateway.examples.internal.examplepb.ServiceA/MethodTwo",
   126  	}
   127  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   128  		return srv.(ServiceAServer).MethodTwo(ctx, req.(*OutMessageA))
   129  	}
   130  	return interceptor(ctx, in, info, handler)
   131  }
   132  
   133  // ServiceA_ServiceDesc is the grpc.ServiceDesc for ServiceA 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 ServiceA_ServiceDesc = grpc.ServiceDesc{
   137  	ServiceName: "grpc.gateway.examples.internal.examplepb.ServiceA",
   138  	HandlerType: (*ServiceAServer)(nil),
   139  	Methods: []grpc.MethodDesc{
   140  		{
   141  			MethodName: "MethodOne",
   142  			Handler:    _ServiceA_MethodOne_Handler,
   143  		},
   144  		{
   145  			MethodName: "MethodTwo",
   146  			Handler:    _ServiceA_MethodTwo_Handler,
   147  		},
   148  	},
   149  	Streams:  []grpc.StreamDesc{},
   150  	Metadata: "examples/internal/proto/examplepb/openapi_merge_a.proto",
   151  }
   152  
   153  // ServiceCClient is the client API for ServiceC service.
   154  //
   155  // 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.
   156  type ServiceCClient interface {
   157  	// ServiceC.MethodOne receives InMessageA and returns OutMessageC
   158  	//
   159  	// Here is the detail explanation about ServiceC.MethodOne.
   160  	MethodOne(ctx context.Context, in *InMessageA, opts ...grpc.CallOption) (*OutMessageC, error)
   161  	// ServiceC.MethodTwo receives OutMessageA and returns InMessageA
   162  	//
   163  	// Here is the detail explanation about ServiceC.MethodTwo.
   164  	MethodTwo(ctx context.Context, in *OutMessageA, opts ...grpc.CallOption) (*InMessageA, error)
   165  }
   166  
   167  type serviceCClient struct {
   168  	cc grpc.ClientConnInterface
   169  }
   170  
   171  func NewServiceCClient(cc grpc.ClientConnInterface) ServiceCClient {
   172  	return &serviceCClient{cc}
   173  }
   174  
   175  func (c *serviceCClient) MethodOne(ctx context.Context, in *InMessageA, opts ...grpc.CallOption) (*OutMessageC, error) {
   176  	out := new(OutMessageC)
   177  	err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.examplepb.ServiceC/MethodOne", in, out, opts...)
   178  	if err != nil {
   179  		return nil, err
   180  	}
   181  	return out, nil
   182  }
   183  
   184  func (c *serviceCClient) MethodTwo(ctx context.Context, in *OutMessageA, opts ...grpc.CallOption) (*InMessageA, error) {
   185  	out := new(InMessageA)
   186  	err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.examplepb.ServiceC/MethodTwo", in, out, opts...)
   187  	if err != nil {
   188  		return nil, err
   189  	}
   190  	return out, nil
   191  }
   192  
   193  // ServiceCServer is the server API for ServiceC service.
   194  // All implementations should embed UnimplementedServiceCServer
   195  // for forward compatibility
   196  type ServiceCServer interface {
   197  	// ServiceC.MethodOne receives InMessageA and returns OutMessageC
   198  	//
   199  	// Here is the detail explanation about ServiceC.MethodOne.
   200  	MethodOne(context.Context, *InMessageA) (*OutMessageC, error)
   201  	// ServiceC.MethodTwo receives OutMessageA and returns InMessageA
   202  	//
   203  	// Here is the detail explanation about ServiceC.MethodTwo.
   204  	MethodTwo(context.Context, *OutMessageA) (*InMessageA, error)
   205  }
   206  
   207  // UnimplementedServiceCServer should be embedded to have forward compatible implementations.
   208  type UnimplementedServiceCServer struct {
   209  }
   210  
   211  func (UnimplementedServiceCServer) MethodOne(context.Context, *InMessageA) (*OutMessageC, error) {
   212  	return nil, status.Errorf(codes.Unimplemented, "method MethodOne not implemented")
   213  }
   214  func (UnimplementedServiceCServer) MethodTwo(context.Context, *OutMessageA) (*InMessageA, error) {
   215  	return nil, status.Errorf(codes.Unimplemented, "method MethodTwo not implemented")
   216  }
   217  
   218  // UnsafeServiceCServer may be embedded to opt out of forward compatibility for this service.
   219  // Use of this interface is not recommended, as added methods to ServiceCServer will
   220  // result in compilation errors.
   221  type UnsafeServiceCServer interface {
   222  	mustEmbedUnimplementedServiceCServer()
   223  }
   224  
   225  func RegisterServiceCServer(s grpc.ServiceRegistrar, srv ServiceCServer) {
   226  	s.RegisterService(&ServiceC_ServiceDesc, srv)
   227  }
   228  
   229  func _ServiceC_MethodOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   230  	in := new(InMessageA)
   231  	if err := dec(in); err != nil {
   232  		return nil, err
   233  	}
   234  	if interceptor == nil {
   235  		return srv.(ServiceCServer).MethodOne(ctx, in)
   236  	}
   237  	info := &grpc.UnaryServerInfo{
   238  		Server:     srv,
   239  		FullMethod: "/grpc.gateway.examples.internal.examplepb.ServiceC/MethodOne",
   240  	}
   241  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   242  		return srv.(ServiceCServer).MethodOne(ctx, req.(*InMessageA))
   243  	}
   244  	return interceptor(ctx, in, info, handler)
   245  }
   246  
   247  func _ServiceC_MethodTwo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   248  	in := new(OutMessageA)
   249  	if err := dec(in); err != nil {
   250  		return nil, err
   251  	}
   252  	if interceptor == nil {
   253  		return srv.(ServiceCServer).MethodTwo(ctx, in)
   254  	}
   255  	info := &grpc.UnaryServerInfo{
   256  		Server:     srv,
   257  		FullMethod: "/grpc.gateway.examples.internal.examplepb.ServiceC/MethodTwo",
   258  	}
   259  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   260  		return srv.(ServiceCServer).MethodTwo(ctx, req.(*OutMessageA))
   261  	}
   262  	return interceptor(ctx, in, info, handler)
   263  }
   264  
   265  // ServiceC_ServiceDesc is the grpc.ServiceDesc for ServiceC service.
   266  // It's only intended for direct use with grpc.RegisterService,
   267  // and not to be introspected or modified (even as a copy)
   268  var ServiceC_ServiceDesc = grpc.ServiceDesc{
   269  	ServiceName: "grpc.gateway.examples.internal.examplepb.ServiceC",
   270  	HandlerType: (*ServiceCServer)(nil),
   271  	Methods: []grpc.MethodDesc{
   272  		{
   273  			MethodName: "MethodOne",
   274  			Handler:    _ServiceC_MethodOne_Handler,
   275  		},
   276  		{
   277  			MethodName: "MethodTwo",
   278  			Handler:    _ServiceC_MethodTwo_Handler,
   279  		},
   280  	},
   281  	Streams:  []grpc.StreamDesc{},
   282  	Metadata: "examples/internal/proto/examplepb/openapi_merge_a.proto",
   283  }
   284  

View as plain text