github.com/Uhtred009/v2ray-core-1@v4.31.2+incompatible/app/router/command/command_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  
     3  package command
     4  
     5  import (
     6  	context "context"
     7  	grpc "google.golang.org/grpc"
     8  	codes "google.golang.org/grpc/codes"
     9  	status "google.golang.org/grpc/status"
    10  )
    11  
    12  // This is a compile-time assertion to ensure that this generated file
    13  // is compatible with the grpc package it is being compiled against.
    14  const _ = grpc.SupportPackageIsVersion7
    15  
    16  // RoutingServiceClient is the client API for RoutingService service.
    17  //
    18  // 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.
    19  type RoutingServiceClient interface {
    20  	SubscribeRoutingStats(ctx context.Context, in *SubscribeRoutingStatsRequest, opts ...grpc.CallOption) (RoutingService_SubscribeRoutingStatsClient, error)
    21  	TestRoute(ctx context.Context, in *TestRouteRequest, opts ...grpc.CallOption) (*RoutingContext, error)
    22  }
    23  
    24  type routingServiceClient struct {
    25  	cc grpc.ClientConnInterface
    26  }
    27  
    28  func NewRoutingServiceClient(cc grpc.ClientConnInterface) RoutingServiceClient {
    29  	return &routingServiceClient{cc}
    30  }
    31  
    32  func (c *routingServiceClient) SubscribeRoutingStats(ctx context.Context, in *SubscribeRoutingStatsRequest, opts ...grpc.CallOption) (RoutingService_SubscribeRoutingStatsClient, error) {
    33  	stream, err := c.cc.NewStream(ctx, &_RoutingService_serviceDesc.Streams[0], "/v2ray.core.app.router.command.RoutingService/SubscribeRoutingStats", opts...)
    34  	if err != nil {
    35  		return nil, err
    36  	}
    37  	x := &routingServiceSubscribeRoutingStatsClient{stream}
    38  	if err := x.ClientStream.SendMsg(in); err != nil {
    39  		return nil, err
    40  	}
    41  	if err := x.ClientStream.CloseSend(); err != nil {
    42  		return nil, err
    43  	}
    44  	return x, nil
    45  }
    46  
    47  type RoutingService_SubscribeRoutingStatsClient interface {
    48  	Recv() (*RoutingContext, error)
    49  	grpc.ClientStream
    50  }
    51  
    52  type routingServiceSubscribeRoutingStatsClient struct {
    53  	grpc.ClientStream
    54  }
    55  
    56  func (x *routingServiceSubscribeRoutingStatsClient) Recv() (*RoutingContext, error) {
    57  	m := new(RoutingContext)
    58  	if err := x.ClientStream.RecvMsg(m); err != nil {
    59  		return nil, err
    60  	}
    61  	return m, nil
    62  }
    63  
    64  func (c *routingServiceClient) TestRoute(ctx context.Context, in *TestRouteRequest, opts ...grpc.CallOption) (*RoutingContext, error) {
    65  	out := new(RoutingContext)
    66  	err := c.cc.Invoke(ctx, "/v2ray.core.app.router.command.RoutingService/TestRoute", in, out, opts...)
    67  	if err != nil {
    68  		return nil, err
    69  	}
    70  	return out, nil
    71  }
    72  
    73  // RoutingServiceServer is the server API for RoutingService service.
    74  // All implementations must embed UnimplementedRoutingServiceServer
    75  // for forward compatibility
    76  type RoutingServiceServer interface {
    77  	SubscribeRoutingStats(*SubscribeRoutingStatsRequest, RoutingService_SubscribeRoutingStatsServer) error
    78  	TestRoute(context.Context, *TestRouteRequest) (*RoutingContext, error)
    79  	mustEmbedUnimplementedRoutingServiceServer()
    80  }
    81  
    82  // UnimplementedRoutingServiceServer must be embedded to have forward compatible implementations.
    83  type UnimplementedRoutingServiceServer struct {
    84  }
    85  
    86  func (UnimplementedRoutingServiceServer) SubscribeRoutingStats(*SubscribeRoutingStatsRequest, RoutingService_SubscribeRoutingStatsServer) error {
    87  	return status.Errorf(codes.Unimplemented, "method SubscribeRoutingStats not implemented")
    88  }
    89  func (UnimplementedRoutingServiceServer) TestRoute(context.Context, *TestRouteRequest) (*RoutingContext, error) {
    90  	return nil, status.Errorf(codes.Unimplemented, "method TestRoute not implemented")
    91  }
    92  func (UnimplementedRoutingServiceServer) mustEmbedUnimplementedRoutingServiceServer() {}
    93  
    94  // UnsafeRoutingServiceServer may be embedded to opt out of forward compatibility for this service.
    95  // Use of this interface is not recommended, as added methods to RoutingServiceServer will
    96  // result in compilation errors.
    97  type UnsafeRoutingServiceServer interface {
    98  	mustEmbedUnimplementedRoutingServiceServer()
    99  }
   100  
   101  func RegisterRoutingServiceServer(s *grpc.Server, srv RoutingServiceServer) {
   102  	s.RegisterService(&_RoutingService_serviceDesc, srv)
   103  }
   104  
   105  func _RoutingService_SubscribeRoutingStats_Handler(srv interface{}, stream grpc.ServerStream) error {
   106  	m := new(SubscribeRoutingStatsRequest)
   107  	if err := stream.RecvMsg(m); err != nil {
   108  		return err
   109  	}
   110  	return srv.(RoutingServiceServer).SubscribeRoutingStats(m, &routingServiceSubscribeRoutingStatsServer{stream})
   111  }
   112  
   113  type RoutingService_SubscribeRoutingStatsServer interface {
   114  	Send(*RoutingContext) error
   115  	grpc.ServerStream
   116  }
   117  
   118  type routingServiceSubscribeRoutingStatsServer struct {
   119  	grpc.ServerStream
   120  }
   121  
   122  func (x *routingServiceSubscribeRoutingStatsServer) Send(m *RoutingContext) error {
   123  	return x.ServerStream.SendMsg(m)
   124  }
   125  
   126  func _RoutingService_TestRoute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   127  	in := new(TestRouteRequest)
   128  	if err := dec(in); err != nil {
   129  		return nil, err
   130  	}
   131  	if interceptor == nil {
   132  		return srv.(RoutingServiceServer).TestRoute(ctx, in)
   133  	}
   134  	info := &grpc.UnaryServerInfo{
   135  		Server:     srv,
   136  		FullMethod: "/v2ray.core.app.router.command.RoutingService/TestRoute",
   137  	}
   138  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   139  		return srv.(RoutingServiceServer).TestRoute(ctx, req.(*TestRouteRequest))
   140  	}
   141  	return interceptor(ctx, in, info, handler)
   142  }
   143  
   144  var _RoutingService_serviceDesc = grpc.ServiceDesc{
   145  	ServiceName: "v2ray.core.app.router.command.RoutingService",
   146  	HandlerType: (*RoutingServiceServer)(nil),
   147  	Methods: []grpc.MethodDesc{
   148  		{
   149  			MethodName: "TestRoute",
   150  			Handler:    _RoutingService_TestRoute_Handler,
   151  		},
   152  	},
   153  	Streams: []grpc.StreamDesc{
   154  		{
   155  			StreamName:    "SubscribeRoutingStats",
   156  			Handler:       _RoutingService_SubscribeRoutingStats_Handler,
   157  			ServerStreams: true,
   158  		},
   159  	},
   160  	Metadata: "app/router/command/command.proto",
   161  }