github.com/moqsien/xraycore@v1.8.5/app/router/command/command_grpc.pb.go (about)

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