github.com/xmplusdev/xmcore@v1.8.11-0.20240412132628-5518b55526af/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  	RoutingService_GetBalancerInfo_FullMethodName        = "/xray.app.router.command.RoutingService/GetBalancerInfo"
    25  	RoutingService_OverrideBalancerTarget_FullMethodName = "/xray.app.router.command.RoutingService/OverrideBalancerTarget"
    26  	RoutingService_AddRule_FullMethodName                = "/xray.app.router.command.RoutingService/AddRule"
    27  	RoutingService_RemoveRule_FullMethodName             = "/xray.app.router.command.RoutingService/RemoveRule"
    28  )
    29  
    30  // RoutingServiceClient is the client API for RoutingService service.
    31  //
    32  // 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.
    33  type RoutingServiceClient interface {
    34  	SubscribeRoutingStats(ctx context.Context, in *SubscribeRoutingStatsRequest, opts ...grpc.CallOption) (RoutingService_SubscribeRoutingStatsClient, error)
    35  	TestRoute(ctx context.Context, in *TestRouteRequest, opts ...grpc.CallOption) (*RoutingContext, error)
    36  	GetBalancerInfo(ctx context.Context, in *GetBalancerInfoRequest, opts ...grpc.CallOption) (*GetBalancerInfoResponse, error)
    37  	OverrideBalancerTarget(ctx context.Context, in *OverrideBalancerTargetRequest, opts ...grpc.CallOption) (*OverrideBalancerTargetResponse, error)
    38  	AddRule(ctx context.Context, in *AddRuleRequest, opts ...grpc.CallOption) (*AddRuleResponse, error)
    39  	RemoveRule(ctx context.Context, in *RemoveRuleRequest, opts ...grpc.CallOption) (*RemoveRuleResponse, error)
    40  }
    41  
    42  type routingServiceClient struct {
    43  	cc grpc.ClientConnInterface
    44  }
    45  
    46  func NewRoutingServiceClient(cc grpc.ClientConnInterface) RoutingServiceClient {
    47  	return &routingServiceClient{cc}
    48  }
    49  
    50  func (c *routingServiceClient) SubscribeRoutingStats(ctx context.Context, in *SubscribeRoutingStatsRequest, opts ...grpc.CallOption) (RoutingService_SubscribeRoutingStatsClient, error) {
    51  	stream, err := c.cc.NewStream(ctx, &RoutingService_ServiceDesc.Streams[0], RoutingService_SubscribeRoutingStats_FullMethodName, opts...)
    52  	if err != nil {
    53  		return nil, err
    54  	}
    55  	x := &routingServiceSubscribeRoutingStatsClient{stream}
    56  	if err := x.ClientStream.SendMsg(in); err != nil {
    57  		return nil, err
    58  	}
    59  	if err := x.ClientStream.CloseSend(); err != nil {
    60  		return nil, err
    61  	}
    62  	return x, nil
    63  }
    64  
    65  type RoutingService_SubscribeRoutingStatsClient interface {
    66  	Recv() (*RoutingContext, error)
    67  	grpc.ClientStream
    68  }
    69  
    70  type routingServiceSubscribeRoutingStatsClient struct {
    71  	grpc.ClientStream
    72  }
    73  
    74  func (x *routingServiceSubscribeRoutingStatsClient) Recv() (*RoutingContext, error) {
    75  	m := new(RoutingContext)
    76  	if err := x.ClientStream.RecvMsg(m); err != nil {
    77  		return nil, err
    78  	}
    79  	return m, nil
    80  }
    81  
    82  func (c *routingServiceClient) TestRoute(ctx context.Context, in *TestRouteRequest, opts ...grpc.CallOption) (*RoutingContext, error) {
    83  	out := new(RoutingContext)
    84  	err := c.cc.Invoke(ctx, RoutingService_TestRoute_FullMethodName, in, out, opts...)
    85  	if err != nil {
    86  		return nil, err
    87  	}
    88  	return out, nil
    89  }
    90  
    91  func (c *routingServiceClient) GetBalancerInfo(ctx context.Context, in *GetBalancerInfoRequest, opts ...grpc.CallOption) (*GetBalancerInfoResponse, error) {
    92  	out := new(GetBalancerInfoResponse)
    93  	err := c.cc.Invoke(ctx, RoutingService_GetBalancerInfo_FullMethodName, in, out, opts...)
    94  	if err != nil {
    95  		return nil, err
    96  	}
    97  	return out, nil
    98  }
    99  
   100  func (c *routingServiceClient) OverrideBalancerTarget(ctx context.Context, in *OverrideBalancerTargetRequest, opts ...grpc.CallOption) (*OverrideBalancerTargetResponse, error) {
   101  	out := new(OverrideBalancerTargetResponse)
   102  	err := c.cc.Invoke(ctx, RoutingService_OverrideBalancerTarget_FullMethodName, in, out, opts...)
   103  	if err != nil {
   104  		return nil, err
   105  	}
   106  	return out, nil
   107  }
   108  
   109  func (c *routingServiceClient) AddRule(ctx context.Context, in *AddRuleRequest, opts ...grpc.CallOption) (*AddRuleResponse, error) {
   110  	out := new(AddRuleResponse)
   111  	err := c.cc.Invoke(ctx, RoutingService_AddRule_FullMethodName, in, out, opts...)
   112  	if err != nil {
   113  		return nil, err
   114  	}
   115  	return out, nil
   116  }
   117  
   118  func (c *routingServiceClient) RemoveRule(ctx context.Context, in *RemoveRuleRequest, opts ...grpc.CallOption) (*RemoveRuleResponse, error) {
   119  	out := new(RemoveRuleResponse)
   120  	err := c.cc.Invoke(ctx, RoutingService_RemoveRule_FullMethodName, in, out, opts...)
   121  	if err != nil {
   122  		return nil, err
   123  	}
   124  	return out, nil
   125  }
   126  
   127  // RoutingServiceServer is the server API for RoutingService service.
   128  // All implementations must embed UnimplementedRoutingServiceServer
   129  // for forward compatibility
   130  type RoutingServiceServer interface {
   131  	SubscribeRoutingStats(*SubscribeRoutingStatsRequest, RoutingService_SubscribeRoutingStatsServer) error
   132  	TestRoute(context.Context, *TestRouteRequest) (*RoutingContext, error)
   133  	GetBalancerInfo(context.Context, *GetBalancerInfoRequest) (*GetBalancerInfoResponse, error)
   134  	OverrideBalancerTarget(context.Context, *OverrideBalancerTargetRequest) (*OverrideBalancerTargetResponse, error)
   135  	AddRule(context.Context, *AddRuleRequest) (*AddRuleResponse, error)
   136  	RemoveRule(context.Context, *RemoveRuleRequest) (*RemoveRuleResponse, error)
   137  	mustEmbedUnimplementedRoutingServiceServer()
   138  }
   139  
   140  // UnimplementedRoutingServiceServer must be embedded to have forward compatible implementations.
   141  type UnimplementedRoutingServiceServer struct {
   142  }
   143  
   144  func (UnimplementedRoutingServiceServer) SubscribeRoutingStats(*SubscribeRoutingStatsRequest, RoutingService_SubscribeRoutingStatsServer) error {
   145  	return status.Errorf(codes.Unimplemented, "method SubscribeRoutingStats not implemented")
   146  }
   147  func (UnimplementedRoutingServiceServer) TestRoute(context.Context, *TestRouteRequest) (*RoutingContext, error) {
   148  	return nil, status.Errorf(codes.Unimplemented, "method TestRoute not implemented")
   149  }
   150  func (UnimplementedRoutingServiceServer) GetBalancerInfo(context.Context, *GetBalancerInfoRequest) (*GetBalancerInfoResponse, error) {
   151  	return nil, status.Errorf(codes.Unimplemented, "method GetBalancerInfo not implemented")
   152  }
   153  func (UnimplementedRoutingServiceServer) OverrideBalancerTarget(context.Context, *OverrideBalancerTargetRequest) (*OverrideBalancerTargetResponse, error) {
   154  	return nil, status.Errorf(codes.Unimplemented, "method OverrideBalancerTarget not implemented")
   155  }
   156  func (UnimplementedRoutingServiceServer) AddRule(context.Context, *AddRuleRequest) (*AddRuleResponse, error) {
   157  	return nil, status.Errorf(codes.Unimplemented, "method AddRule not implemented")
   158  }
   159  func (UnimplementedRoutingServiceServer) RemoveRule(context.Context, *RemoveRuleRequest) (*RemoveRuleResponse, error) {
   160  	return nil, status.Errorf(codes.Unimplemented, "method RemoveRule not implemented")
   161  }
   162  func (UnimplementedRoutingServiceServer) mustEmbedUnimplementedRoutingServiceServer() {}
   163  
   164  // UnsafeRoutingServiceServer may be embedded to opt out of forward compatibility for this service.
   165  // Use of this interface is not recommended, as added methods to RoutingServiceServer will
   166  // result in compilation errors.
   167  type UnsafeRoutingServiceServer interface {
   168  	mustEmbedUnimplementedRoutingServiceServer()
   169  }
   170  
   171  func RegisterRoutingServiceServer(s grpc.ServiceRegistrar, srv RoutingServiceServer) {
   172  	s.RegisterService(&RoutingService_ServiceDesc, srv)
   173  }
   174  
   175  func _RoutingService_SubscribeRoutingStats_Handler(srv interface{}, stream grpc.ServerStream) error {
   176  	m := new(SubscribeRoutingStatsRequest)
   177  	if err := stream.RecvMsg(m); err != nil {
   178  		return err
   179  	}
   180  	return srv.(RoutingServiceServer).SubscribeRoutingStats(m, &routingServiceSubscribeRoutingStatsServer{stream})
   181  }
   182  
   183  type RoutingService_SubscribeRoutingStatsServer interface {
   184  	Send(*RoutingContext) error
   185  	grpc.ServerStream
   186  }
   187  
   188  type routingServiceSubscribeRoutingStatsServer struct {
   189  	grpc.ServerStream
   190  }
   191  
   192  func (x *routingServiceSubscribeRoutingStatsServer) Send(m *RoutingContext) error {
   193  	return x.ServerStream.SendMsg(m)
   194  }
   195  
   196  func _RoutingService_TestRoute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   197  	in := new(TestRouteRequest)
   198  	if err := dec(in); err != nil {
   199  		return nil, err
   200  	}
   201  	if interceptor == nil {
   202  		return srv.(RoutingServiceServer).TestRoute(ctx, in)
   203  	}
   204  	info := &grpc.UnaryServerInfo{
   205  		Server:     srv,
   206  		FullMethod: RoutingService_TestRoute_FullMethodName,
   207  	}
   208  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   209  		return srv.(RoutingServiceServer).TestRoute(ctx, req.(*TestRouteRequest))
   210  	}
   211  	return interceptor(ctx, in, info, handler)
   212  }
   213  
   214  func _RoutingService_GetBalancerInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   215  	in := new(GetBalancerInfoRequest)
   216  	if err := dec(in); err != nil {
   217  		return nil, err
   218  	}
   219  	if interceptor == nil {
   220  		return srv.(RoutingServiceServer).GetBalancerInfo(ctx, in)
   221  	}
   222  	info := &grpc.UnaryServerInfo{
   223  		Server:     srv,
   224  		FullMethod: RoutingService_GetBalancerInfo_FullMethodName,
   225  	}
   226  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   227  		return srv.(RoutingServiceServer).GetBalancerInfo(ctx, req.(*GetBalancerInfoRequest))
   228  	}
   229  	return interceptor(ctx, in, info, handler)
   230  }
   231  
   232  func _RoutingService_OverrideBalancerTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   233  	in := new(OverrideBalancerTargetRequest)
   234  	if err := dec(in); err != nil {
   235  		return nil, err
   236  	}
   237  	if interceptor == nil {
   238  		return srv.(RoutingServiceServer).OverrideBalancerTarget(ctx, in)
   239  	}
   240  	info := &grpc.UnaryServerInfo{
   241  		Server:     srv,
   242  		FullMethod: RoutingService_OverrideBalancerTarget_FullMethodName,
   243  	}
   244  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   245  		return srv.(RoutingServiceServer).OverrideBalancerTarget(ctx, req.(*OverrideBalancerTargetRequest))
   246  	}
   247  	return interceptor(ctx, in, info, handler)
   248  }
   249  
   250  func _RoutingService_AddRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   251  	in := new(AddRuleRequest)
   252  	if err := dec(in); err != nil {
   253  		return nil, err
   254  	}
   255  	if interceptor == nil {
   256  		return srv.(RoutingServiceServer).AddRule(ctx, in)
   257  	}
   258  	info := &grpc.UnaryServerInfo{
   259  		Server:     srv,
   260  		FullMethod: RoutingService_AddRule_FullMethodName,
   261  	}
   262  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   263  		return srv.(RoutingServiceServer).AddRule(ctx, req.(*AddRuleRequest))
   264  	}
   265  	return interceptor(ctx, in, info, handler)
   266  }
   267  
   268  func _RoutingService_RemoveRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   269  	in := new(RemoveRuleRequest)
   270  	if err := dec(in); err != nil {
   271  		return nil, err
   272  	}
   273  	if interceptor == nil {
   274  		return srv.(RoutingServiceServer).RemoveRule(ctx, in)
   275  	}
   276  	info := &grpc.UnaryServerInfo{
   277  		Server:     srv,
   278  		FullMethod: RoutingService_RemoveRule_FullMethodName,
   279  	}
   280  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   281  		return srv.(RoutingServiceServer).RemoveRule(ctx, req.(*RemoveRuleRequest))
   282  	}
   283  	return interceptor(ctx, in, info, handler)
   284  }
   285  
   286  // RoutingService_ServiceDesc is the grpc.ServiceDesc for RoutingService service.
   287  // It's only intended for direct use with grpc.RegisterService,
   288  // and not to be introspected or modified (even as a copy)
   289  var RoutingService_ServiceDesc = grpc.ServiceDesc{
   290  	ServiceName: "xray.app.router.command.RoutingService",
   291  	HandlerType: (*RoutingServiceServer)(nil),
   292  	Methods: []grpc.MethodDesc{
   293  		{
   294  			MethodName: "TestRoute",
   295  			Handler:    _RoutingService_TestRoute_Handler,
   296  		},
   297  		{
   298  			MethodName: "GetBalancerInfo",
   299  			Handler:    _RoutingService_GetBalancerInfo_Handler,
   300  		},
   301  		{
   302  			MethodName: "OverrideBalancerTarget",
   303  			Handler:    _RoutingService_OverrideBalancerTarget_Handler,
   304  		},
   305  		{
   306  			MethodName: "AddRule",
   307  			Handler:    _RoutingService_AddRule_Handler,
   308  		},
   309  		{
   310  			MethodName: "RemoveRule",
   311  			Handler:    _RoutingService_RemoveRule_Handler,
   312  		},
   313  	},
   314  	Streams: []grpc.StreamDesc{
   315  		{
   316  			StreamName:    "SubscribeRoutingStats",
   317  			Handler:       _RoutingService_SubscribeRoutingStats_Handler,
   318  			ServerStreams: true,
   319  		},
   320  	},
   321  	Metadata: "app/router/command/command.proto",
   322  }