2020-11-25 14:01:53 +03:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2022-02-05 05:59:50 +03:00
// versions:
2024-08-22 17:18:36 +03:00
// - protoc-gen-go-grpc v1.5.1
2024-10-16 07:01:04 +03:00
// - protoc v5.28.2
2022-02-05 05:59:50 +03:00
// source: app/router/command/command.proto
2020-11-25 14:01:53 +03:00
package command
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
2024-08-22 17:18:36 +03:00
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc . SupportPackageIsVersion9
2020-11-25 14:01:53 +03:00
2024-03-29 08:39:59 +03:00
const (
RoutingService_SubscribeRoutingStats_FullMethodName = "/xray.app.router.command.RoutingService/SubscribeRoutingStats"
RoutingService_TestRoute_FullMethodName = "/xray.app.router.command.RoutingService/TestRoute"
RoutingService_GetBalancerInfo_FullMethodName = "/xray.app.router.command.RoutingService/GetBalancerInfo"
RoutingService_OverrideBalancerTarget_FullMethodName = "/xray.app.router.command.RoutingService/OverrideBalancerTarget"
RoutingService_AddRule_FullMethodName = "/xray.app.router.command.RoutingService/AddRule"
RoutingService_RemoveRule_FullMethodName = "/xray.app.router.command.RoutingService/RemoveRule"
)
2020-11-25 14:01:53 +03:00
// RoutingServiceClient is the client API for RoutingService service.
//
// 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.
type RoutingServiceClient interface {
2024-08-22 17:18:36 +03:00
SubscribeRoutingStats ( ctx context . Context , in * SubscribeRoutingStatsRequest , opts ... grpc . CallOption ) ( grpc . ServerStreamingClient [ RoutingContext ] , error )
2020-11-25 14:01:53 +03:00
TestRoute ( ctx context . Context , in * TestRouteRequest , opts ... grpc . CallOption ) ( * RoutingContext , error )
2024-02-18 06:51:37 +03:00
GetBalancerInfo ( ctx context . Context , in * GetBalancerInfoRequest , opts ... grpc . CallOption ) ( * GetBalancerInfoResponse , error )
OverrideBalancerTarget ( ctx context . Context , in * OverrideBalancerTargetRequest , opts ... grpc . CallOption ) ( * OverrideBalancerTargetResponse , error )
2024-03-29 18:17:36 +03:00
AddRule ( ctx context . Context , in * AddRuleRequest , opts ... grpc . CallOption ) ( * AddRuleResponse , error )
RemoveRule ( ctx context . Context , in * RemoveRuleRequest , opts ... grpc . CallOption ) ( * RemoveRuleResponse , error )
2020-11-25 14:01:53 +03:00
}
type routingServiceClient struct {
cc grpc . ClientConnInterface
}
func NewRoutingServiceClient ( cc grpc . ClientConnInterface ) RoutingServiceClient {
return & routingServiceClient { cc }
}
2024-08-22 17:18:36 +03:00
func ( c * routingServiceClient ) SubscribeRoutingStats ( ctx context . Context , in * SubscribeRoutingStatsRequest , opts ... grpc . CallOption ) ( grpc . ServerStreamingClient [ RoutingContext ] , error ) {
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
stream , err := c . cc . NewStream ( ctx , & RoutingService_ServiceDesc . Streams [ 0 ] , RoutingService_SubscribeRoutingStats_FullMethodName , cOpts ... )
2020-11-25 14:01:53 +03:00
if err != nil {
return nil , err
}
2024-08-22 17:18:36 +03:00
x := & grpc . GenericClientStream [ SubscribeRoutingStatsRequest , RoutingContext ] { ClientStream : stream }
2020-11-25 14:01:53 +03:00
if err := x . ClientStream . SendMsg ( in ) ; err != nil {
return nil , err
}
if err := x . ClientStream . CloseSend ( ) ; err != nil {
return nil , err
}
return x , nil
}
2024-08-22 17:18:36 +03:00
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type RoutingService_SubscribeRoutingStatsClient = grpc . ServerStreamingClient [ RoutingContext ]
2020-11-25 14:01:53 +03:00
func ( c * routingServiceClient ) TestRoute ( ctx context . Context , in * TestRouteRequest , opts ... grpc . CallOption ) ( * RoutingContext , error ) {
2024-08-22 17:18:36 +03:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
2020-11-25 14:01:53 +03:00
out := new ( RoutingContext )
2024-08-22 17:18:36 +03:00
err := c . cc . Invoke ( ctx , RoutingService_TestRoute_FullMethodName , in , out , cOpts ... )
2020-11-25 14:01:53 +03:00
if err != nil {
return nil , err
}
return out , nil
}
2024-02-18 06:51:37 +03:00
func ( c * routingServiceClient ) GetBalancerInfo ( ctx context . Context , in * GetBalancerInfoRequest , opts ... grpc . CallOption ) ( * GetBalancerInfoResponse , error ) {
2024-08-22 17:18:36 +03:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
2024-02-18 06:51:37 +03:00
out := new ( GetBalancerInfoResponse )
2024-08-22 17:18:36 +03:00
err := c . cc . Invoke ( ctx , RoutingService_GetBalancerInfo_FullMethodName , in , out , cOpts ... )
2024-02-18 06:51:37 +03:00
if err != nil {
return nil , err
}
return out , nil
}
func ( c * routingServiceClient ) OverrideBalancerTarget ( ctx context . Context , in * OverrideBalancerTargetRequest , opts ... grpc . CallOption ) ( * OverrideBalancerTargetResponse , error ) {
2024-08-22 17:18:36 +03:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
2024-02-18 06:51:37 +03:00
out := new ( OverrideBalancerTargetResponse )
2024-08-22 17:18:36 +03:00
err := c . cc . Invoke ( ctx , RoutingService_OverrideBalancerTarget_FullMethodName , in , out , cOpts ... )
2024-03-29 18:17:36 +03:00
if err != nil {
return nil , err
}
return out , nil
}
func ( c * routingServiceClient ) AddRule ( ctx context . Context , in * AddRuleRequest , opts ... grpc . CallOption ) ( * AddRuleResponse , error ) {
2024-08-22 17:18:36 +03:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
2024-03-29 18:17:36 +03:00
out := new ( AddRuleResponse )
2024-08-22 17:18:36 +03:00
err := c . cc . Invoke ( ctx , RoutingService_AddRule_FullMethodName , in , out , cOpts ... )
2024-03-29 18:17:36 +03:00
if err != nil {
return nil , err
}
return out , nil
}
func ( c * routingServiceClient ) RemoveRule ( ctx context . Context , in * RemoveRuleRequest , opts ... grpc . CallOption ) ( * RemoveRuleResponse , error ) {
2024-08-22 17:18:36 +03:00
cOpts := append ( [ ] grpc . CallOption { grpc . StaticMethod ( ) } , opts ... )
2024-03-29 18:17:36 +03:00
out := new ( RemoveRuleResponse )
2024-08-22 17:18:36 +03:00
err := c . cc . Invoke ( ctx , RoutingService_RemoveRule_FullMethodName , in , out , cOpts ... )
2024-02-18 06:51:37 +03:00
if err != nil {
return nil , err
}
return out , nil
}
2020-11-25 14:01:53 +03:00
// RoutingServiceServer is the server API for RoutingService service.
// All implementations must embed UnimplementedRoutingServiceServer
2024-08-22 17:18:36 +03:00
// for forward compatibility.
2020-11-25 14:01:53 +03:00
type RoutingServiceServer interface {
2024-08-22 17:18:36 +03:00
SubscribeRoutingStats ( * SubscribeRoutingStatsRequest , grpc . ServerStreamingServer [ RoutingContext ] ) error
2020-11-25 14:01:53 +03:00
TestRoute ( context . Context , * TestRouteRequest ) ( * RoutingContext , error )
2024-02-18 06:51:37 +03:00
GetBalancerInfo ( context . Context , * GetBalancerInfoRequest ) ( * GetBalancerInfoResponse , error )
OverrideBalancerTarget ( context . Context , * OverrideBalancerTargetRequest ) ( * OverrideBalancerTargetResponse , error )
2024-03-29 18:17:36 +03:00
AddRule ( context . Context , * AddRuleRequest ) ( * AddRuleResponse , error )
RemoveRule ( context . Context , * RemoveRuleRequest ) ( * RemoveRuleResponse , error )
2020-11-25 14:01:53 +03:00
mustEmbedUnimplementedRoutingServiceServer ( )
}
2024-08-22 17:18:36 +03:00
// UnimplementedRoutingServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedRoutingServiceServer struct { }
2020-11-25 14:01:53 +03:00
2024-08-22 17:18:36 +03:00
func ( UnimplementedRoutingServiceServer ) SubscribeRoutingStats ( * SubscribeRoutingStatsRequest , grpc . ServerStreamingServer [ RoutingContext ] ) error {
2020-11-25 14:01:53 +03:00
return status . Errorf ( codes . Unimplemented , "method SubscribeRoutingStats not implemented" )
}
func ( UnimplementedRoutingServiceServer ) TestRoute ( context . Context , * TestRouteRequest ) ( * RoutingContext , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method TestRoute not implemented" )
}
2024-02-18 06:51:37 +03:00
func ( UnimplementedRoutingServiceServer ) GetBalancerInfo ( context . Context , * GetBalancerInfoRequest ) ( * GetBalancerInfoResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method GetBalancerInfo not implemented" )
}
func ( UnimplementedRoutingServiceServer ) OverrideBalancerTarget ( context . Context , * OverrideBalancerTargetRequest ) ( * OverrideBalancerTargetResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method OverrideBalancerTarget not implemented" )
}
2024-03-29 18:17:36 +03:00
func ( UnimplementedRoutingServiceServer ) AddRule ( context . Context , * AddRuleRequest ) ( * AddRuleResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method AddRule not implemented" )
}
func ( UnimplementedRoutingServiceServer ) RemoveRule ( context . Context , * RemoveRuleRequest ) ( * RemoveRuleResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method RemoveRule not implemented" )
}
2020-11-25 14:01:53 +03:00
func ( UnimplementedRoutingServiceServer ) mustEmbedUnimplementedRoutingServiceServer ( ) { }
2024-08-22 17:18:36 +03:00
func ( UnimplementedRoutingServiceServer ) testEmbeddedByValue ( ) { }
2020-11-25 14:01:53 +03:00
// UnsafeRoutingServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to RoutingServiceServer will
// result in compilation errors.
type UnsafeRoutingServiceServer interface {
mustEmbedUnimplementedRoutingServiceServer ( )
}
func RegisterRoutingServiceServer ( s grpc . ServiceRegistrar , srv RoutingServiceServer ) {
2024-08-22 17:18:36 +03:00
// If the following call pancis, it indicates UnimplementedRoutingServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t , ok := srv . ( interface { testEmbeddedByValue ( ) } ) ; ok {
t . testEmbeddedByValue ( )
}
2021-01-21 21:58:19 +03:00
s . RegisterService ( & RoutingService_ServiceDesc , srv )
2020-11-25 14:01:53 +03:00
}
func _RoutingService_SubscribeRoutingStats_Handler ( srv interface { } , stream grpc . ServerStream ) error {
m := new ( SubscribeRoutingStatsRequest )
if err := stream . RecvMsg ( m ) ; err != nil {
return err
}
2024-08-22 17:18:36 +03:00
return srv . ( RoutingServiceServer ) . SubscribeRoutingStats ( m , & grpc . GenericServerStream [ SubscribeRoutingStatsRequest , RoutingContext ] { ServerStream : stream } )
2020-11-25 14:01:53 +03:00
}
2024-08-22 17:18:36 +03:00
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type RoutingService_SubscribeRoutingStatsServer = grpc . ServerStreamingServer [ RoutingContext ]
2020-11-25 14:01:53 +03:00
func _RoutingService_TestRoute_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( TestRouteRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( RoutingServiceServer ) . TestRoute ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2024-03-29 08:39:59 +03:00
FullMethod : RoutingService_TestRoute_FullMethodName ,
2020-11-25 14:01:53 +03:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( RoutingServiceServer ) . TestRoute ( ctx , req . ( * TestRouteRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2024-02-18 06:51:37 +03:00
func _RoutingService_GetBalancerInfo_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( GetBalancerInfoRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( RoutingServiceServer ) . GetBalancerInfo ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2024-03-29 08:39:59 +03:00
FullMethod : RoutingService_GetBalancerInfo_FullMethodName ,
2024-02-18 06:51:37 +03:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( RoutingServiceServer ) . GetBalancerInfo ( ctx , req . ( * GetBalancerInfoRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _RoutingService_OverrideBalancerTarget_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( OverrideBalancerTargetRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( RoutingServiceServer ) . OverrideBalancerTarget ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2024-03-29 08:39:59 +03:00
FullMethod : RoutingService_OverrideBalancerTarget_FullMethodName ,
2024-02-18 06:51:37 +03:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( RoutingServiceServer ) . OverrideBalancerTarget ( ctx , req . ( * OverrideBalancerTargetRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2024-03-29 18:17:36 +03:00
func _RoutingService_AddRule_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( AddRuleRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( RoutingServiceServer ) . AddRule ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2024-03-29 08:39:59 +03:00
FullMethod : RoutingService_AddRule_FullMethodName ,
2024-03-29 18:17:36 +03:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( RoutingServiceServer ) . AddRule ( ctx , req . ( * AddRuleRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _RoutingService_RemoveRule_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( RemoveRuleRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( RoutingServiceServer ) . RemoveRule ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2024-03-29 08:39:59 +03:00
FullMethod : RoutingService_RemoveRule_FullMethodName ,
2024-03-29 18:17:36 +03:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( RoutingServiceServer ) . RemoveRule ( ctx , req . ( * RemoveRuleRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2021-01-21 21:58:19 +03:00
// RoutingService_ServiceDesc is the grpc.ServiceDesc for RoutingService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var RoutingService_ServiceDesc = grpc . ServiceDesc {
2020-11-25 14:01:53 +03:00
ServiceName : "xray.app.router.command.RoutingService" ,
HandlerType : ( * RoutingServiceServer ) ( nil ) ,
Methods : [ ] grpc . MethodDesc {
{
MethodName : "TestRoute" ,
Handler : _RoutingService_TestRoute_Handler ,
} ,
2024-02-18 06:51:37 +03:00
{
MethodName : "GetBalancerInfo" ,
Handler : _RoutingService_GetBalancerInfo_Handler ,
} ,
{
MethodName : "OverrideBalancerTarget" ,
Handler : _RoutingService_OverrideBalancerTarget_Handler ,
} ,
2024-03-29 18:17:36 +03:00
{
MethodName : "AddRule" ,
Handler : _RoutingService_AddRule_Handler ,
} ,
{
MethodName : "RemoveRule" ,
Handler : _RoutingService_RemoveRule_Handler ,
} ,
2020-11-25 14:01:53 +03:00
} ,
Streams : [ ] grpc . StreamDesc {
{
StreamName : "SubscribeRoutingStats" ,
Handler : _RoutingService_SubscribeRoutingStats_Handler ,
ServerStreams : true ,
} ,
} ,
Metadata : "app/router/command/command.proto" ,
}