github.com/yandex/pandora@v0.5.32/examples/grpc/server/target_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  // versions:
     3  // - protoc-gen-go-grpc v1.2.0
     4  // - protoc             v3.21.9
     5  // source: target.proto
     6  
     7  package server
     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  // TargetServiceClient is the client API for TargetService 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 TargetServiceClient interface {
    25  	Hello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error)
    26  	Auth(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthResponse, error)
    27  	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
    28  	Order(ctx context.Context, in *OrderRequest, opts ...grpc.CallOption) (*OrderResponse, error)
    29  	Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsResponse, error)
    30  	Reset(ctx context.Context, in *ResetRequest, opts ...grpc.CallOption) (*ResetResponse, error)
    31  }
    32  
    33  type targetServiceClient struct {
    34  	cc grpc.ClientConnInterface
    35  }
    36  
    37  func NewTargetServiceClient(cc grpc.ClientConnInterface) TargetServiceClient {
    38  	return &targetServiceClient{cc}
    39  }
    40  
    41  func (c *targetServiceClient) Hello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error) {
    42  	out := new(HelloResponse)
    43  	err := c.cc.Invoke(ctx, "/target.TargetService/Hello", in, out, opts...)
    44  	if err != nil {
    45  		return nil, err
    46  	}
    47  	return out, nil
    48  }
    49  
    50  func (c *targetServiceClient) Auth(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthResponse, error) {
    51  	out := new(AuthResponse)
    52  	err := c.cc.Invoke(ctx, "/target.TargetService/Auth", in, out, opts...)
    53  	if err != nil {
    54  		return nil, err
    55  	}
    56  	return out, nil
    57  }
    58  
    59  func (c *targetServiceClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) {
    60  	out := new(ListResponse)
    61  	err := c.cc.Invoke(ctx, "/target.TargetService/List", in, out, opts...)
    62  	if err != nil {
    63  		return nil, err
    64  	}
    65  	return out, nil
    66  }
    67  
    68  func (c *targetServiceClient) Order(ctx context.Context, in *OrderRequest, opts ...grpc.CallOption) (*OrderResponse, error) {
    69  	out := new(OrderResponse)
    70  	err := c.cc.Invoke(ctx, "/target.TargetService/Order", in, out, opts...)
    71  	if err != nil {
    72  		return nil, err
    73  	}
    74  	return out, nil
    75  }
    76  
    77  func (c *targetServiceClient) Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsResponse, error) {
    78  	out := new(StatsResponse)
    79  	err := c.cc.Invoke(ctx, "/target.TargetService/Stats", in, out, opts...)
    80  	if err != nil {
    81  		return nil, err
    82  	}
    83  	return out, nil
    84  }
    85  
    86  func (c *targetServiceClient) Reset(ctx context.Context, in *ResetRequest, opts ...grpc.CallOption) (*ResetResponse, error) {
    87  	out := new(ResetResponse)
    88  	err := c.cc.Invoke(ctx, "/target.TargetService/Reset", in, out, opts...)
    89  	if err != nil {
    90  		return nil, err
    91  	}
    92  	return out, nil
    93  }
    94  
    95  // TargetServiceServer is the server API for TargetService service.
    96  // All implementations must embed UnimplementedTargetServiceServer
    97  // for forward compatibility
    98  type TargetServiceServer interface {
    99  	Hello(context.Context, *HelloRequest) (*HelloResponse, error)
   100  	Auth(context.Context, *AuthRequest) (*AuthResponse, error)
   101  	List(context.Context, *ListRequest) (*ListResponse, error)
   102  	Order(context.Context, *OrderRequest) (*OrderResponse, error)
   103  	Stats(context.Context, *StatsRequest) (*StatsResponse, error)
   104  	Reset(context.Context, *ResetRequest) (*ResetResponse, error)
   105  	mustEmbedUnimplementedTargetServiceServer()
   106  }
   107  
   108  // UnimplementedTargetServiceServer must be embedded to have forward compatible implementations.
   109  type UnimplementedTargetServiceServer struct {
   110  }
   111  
   112  func (UnimplementedTargetServiceServer) Hello(context.Context, *HelloRequest) (*HelloResponse, error) {
   113  	return nil, status.Errorf(codes.Unimplemented, "method Hello not implemented")
   114  }
   115  func (UnimplementedTargetServiceServer) Auth(context.Context, *AuthRequest) (*AuthResponse, error) {
   116  	return nil, status.Errorf(codes.Unimplemented, "method Auth not implemented")
   117  }
   118  func (UnimplementedTargetServiceServer) List(context.Context, *ListRequest) (*ListResponse, error) {
   119  	return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
   120  }
   121  func (UnimplementedTargetServiceServer) Order(context.Context, *OrderRequest) (*OrderResponse, error) {
   122  	return nil, status.Errorf(codes.Unimplemented, "method Order not implemented")
   123  }
   124  func (UnimplementedTargetServiceServer) Stats(context.Context, *StatsRequest) (*StatsResponse, error) {
   125  	return nil, status.Errorf(codes.Unimplemented, "method Stats not implemented")
   126  }
   127  func (UnimplementedTargetServiceServer) Reset(context.Context, *ResetRequest) (*ResetResponse, error) {
   128  	return nil, status.Errorf(codes.Unimplemented, "method Reset not implemented")
   129  }
   130  func (UnimplementedTargetServiceServer) mustEmbedUnimplementedTargetServiceServer() {}
   131  
   132  // UnsafeTargetServiceServer may be embedded to opt out of forward compatibility for this service.
   133  // Use of this interface is not recommended, as added methods to TargetServiceServer will
   134  // result in compilation errors.
   135  type UnsafeTargetServiceServer interface {
   136  	mustEmbedUnimplementedTargetServiceServer()
   137  }
   138  
   139  func RegisterTargetServiceServer(s grpc.ServiceRegistrar, srv TargetServiceServer) {
   140  	s.RegisterService(&TargetService_ServiceDesc, srv)
   141  }
   142  
   143  func _TargetService_Hello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   144  	in := new(HelloRequest)
   145  	if err := dec(in); err != nil {
   146  		return nil, err
   147  	}
   148  	if interceptor == nil {
   149  		return srv.(TargetServiceServer).Hello(ctx, in)
   150  	}
   151  	info := &grpc.UnaryServerInfo{
   152  		Server:     srv,
   153  		FullMethod: "/target.TargetService/Hello",
   154  	}
   155  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   156  		return srv.(TargetServiceServer).Hello(ctx, req.(*HelloRequest))
   157  	}
   158  	return interceptor(ctx, in, info, handler)
   159  }
   160  
   161  func _TargetService_Auth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   162  	in := new(AuthRequest)
   163  	if err := dec(in); err != nil {
   164  		return nil, err
   165  	}
   166  	if interceptor == nil {
   167  		return srv.(TargetServiceServer).Auth(ctx, in)
   168  	}
   169  	info := &grpc.UnaryServerInfo{
   170  		Server:     srv,
   171  		FullMethod: "/target.TargetService/Auth",
   172  	}
   173  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   174  		return srv.(TargetServiceServer).Auth(ctx, req.(*AuthRequest))
   175  	}
   176  	return interceptor(ctx, in, info, handler)
   177  }
   178  
   179  func _TargetService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   180  	in := new(ListRequest)
   181  	if err := dec(in); err != nil {
   182  		return nil, err
   183  	}
   184  	if interceptor == nil {
   185  		return srv.(TargetServiceServer).List(ctx, in)
   186  	}
   187  	info := &grpc.UnaryServerInfo{
   188  		Server:     srv,
   189  		FullMethod: "/target.TargetService/List",
   190  	}
   191  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   192  		return srv.(TargetServiceServer).List(ctx, req.(*ListRequest))
   193  	}
   194  	return interceptor(ctx, in, info, handler)
   195  }
   196  
   197  func _TargetService_Order_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   198  	in := new(OrderRequest)
   199  	if err := dec(in); err != nil {
   200  		return nil, err
   201  	}
   202  	if interceptor == nil {
   203  		return srv.(TargetServiceServer).Order(ctx, in)
   204  	}
   205  	info := &grpc.UnaryServerInfo{
   206  		Server:     srv,
   207  		FullMethod: "/target.TargetService/Order",
   208  	}
   209  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   210  		return srv.(TargetServiceServer).Order(ctx, req.(*OrderRequest))
   211  	}
   212  	return interceptor(ctx, in, info, handler)
   213  }
   214  
   215  func _TargetService_Stats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   216  	in := new(StatsRequest)
   217  	if err := dec(in); err != nil {
   218  		return nil, err
   219  	}
   220  	if interceptor == nil {
   221  		return srv.(TargetServiceServer).Stats(ctx, in)
   222  	}
   223  	info := &grpc.UnaryServerInfo{
   224  		Server:     srv,
   225  		FullMethod: "/target.TargetService/Stats",
   226  	}
   227  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   228  		return srv.(TargetServiceServer).Stats(ctx, req.(*StatsRequest))
   229  	}
   230  	return interceptor(ctx, in, info, handler)
   231  }
   232  
   233  func _TargetService_Reset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   234  	in := new(ResetRequest)
   235  	if err := dec(in); err != nil {
   236  		return nil, err
   237  	}
   238  	if interceptor == nil {
   239  		return srv.(TargetServiceServer).Reset(ctx, in)
   240  	}
   241  	info := &grpc.UnaryServerInfo{
   242  		Server:     srv,
   243  		FullMethod: "/target.TargetService/Reset",
   244  	}
   245  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   246  		return srv.(TargetServiceServer).Reset(ctx, req.(*ResetRequest))
   247  	}
   248  	return interceptor(ctx, in, info, handler)
   249  }
   250  
   251  // TargetService_ServiceDesc is the grpc.ServiceDesc for TargetService service.
   252  // It's only intended for direct use with grpc.RegisterService,
   253  // and not to be introspected or modified (even as a copy)
   254  var TargetService_ServiceDesc = grpc.ServiceDesc{
   255  	ServiceName: "target.TargetService",
   256  	HandlerType: (*TargetServiceServer)(nil),
   257  	Methods: []grpc.MethodDesc{
   258  		{
   259  			MethodName: "Hello",
   260  			Handler:    _TargetService_Hello_Handler,
   261  		},
   262  		{
   263  			MethodName: "Auth",
   264  			Handler:    _TargetService_Auth_Handler,
   265  		},
   266  		{
   267  			MethodName: "List",
   268  			Handler:    _TargetService_List_Handler,
   269  		},
   270  		{
   271  			MethodName: "Order",
   272  			Handler:    _TargetService_Order_Handler,
   273  		},
   274  		{
   275  			MethodName: "Stats",
   276  			Handler:    _TargetService_Stats_Handler,
   277  		},
   278  		{
   279  			MethodName: "Reset",
   280  			Handler:    _TargetService_Reset_Handler,
   281  		},
   282  	},
   283  	Streams:  []grpc.StreamDesc{},
   284  	Metadata: "target.proto",
   285  }