github.com/imannamdari/v2ray-core/v5@v5.0.5/app/stats/command/command_grpc.pb.go (about)

     1  package command
     2  
     3  import (
     4  	context "context"
     5  	grpc "google.golang.org/grpc"
     6  	codes "google.golang.org/grpc/codes"
     7  	status "google.golang.org/grpc/status"
     8  )
     9  
    10  // This is a compile-time assertion to ensure that this generated file
    11  // is compatible with the grpc package it is being compiled against.
    12  // Requires gRPC-Go v1.32.0 or later.
    13  const _ = grpc.SupportPackageIsVersion7
    14  
    15  // StatsServiceClient is the client API for StatsService service.
    16  //
    17  // 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.
    18  type StatsServiceClient interface {
    19  	GetStats(ctx context.Context, in *GetStatsRequest, opts ...grpc.CallOption) (*GetStatsResponse, error)
    20  	QueryStats(ctx context.Context, in *QueryStatsRequest, opts ...grpc.CallOption) (*QueryStatsResponse, error)
    21  	GetSysStats(ctx context.Context, in *SysStatsRequest, opts ...grpc.CallOption) (*SysStatsResponse, error)
    22  }
    23  
    24  type statsServiceClient struct {
    25  	cc grpc.ClientConnInterface
    26  }
    27  
    28  func NewStatsServiceClient(cc grpc.ClientConnInterface) StatsServiceClient {
    29  	return &statsServiceClient{cc}
    30  }
    31  
    32  func (c *statsServiceClient) GetStats(ctx context.Context, in *GetStatsRequest, opts ...grpc.CallOption) (*GetStatsResponse, error) {
    33  	out := new(GetStatsResponse)
    34  	err := c.cc.Invoke(ctx, "/v2ray.core.app.stats.command.StatsService/GetStats", in, out, opts...)
    35  	if err != nil {
    36  		return nil, err
    37  	}
    38  	return out, nil
    39  }
    40  
    41  func (c *statsServiceClient) QueryStats(ctx context.Context, in *QueryStatsRequest, opts ...grpc.CallOption) (*QueryStatsResponse, error) {
    42  	out := new(QueryStatsResponse)
    43  	err := c.cc.Invoke(ctx, "/v2ray.core.app.stats.command.StatsService/QueryStats", in, out, opts...)
    44  	if err != nil {
    45  		return nil, err
    46  	}
    47  	return out, nil
    48  }
    49  
    50  func (c *statsServiceClient) GetSysStats(ctx context.Context, in *SysStatsRequest, opts ...grpc.CallOption) (*SysStatsResponse, error) {
    51  	out := new(SysStatsResponse)
    52  	err := c.cc.Invoke(ctx, "/v2ray.core.app.stats.command.StatsService/GetSysStats", in, out, opts...)
    53  	if err != nil {
    54  		return nil, err
    55  	}
    56  	return out, nil
    57  }
    58  
    59  // StatsServiceServer is the server API for StatsService service.
    60  // All implementations must embed UnimplementedStatsServiceServer
    61  // for forward compatibility
    62  type StatsServiceServer interface {
    63  	GetStats(context.Context, *GetStatsRequest) (*GetStatsResponse, error)
    64  	QueryStats(context.Context, *QueryStatsRequest) (*QueryStatsResponse, error)
    65  	GetSysStats(context.Context, *SysStatsRequest) (*SysStatsResponse, error)
    66  	mustEmbedUnimplementedStatsServiceServer()
    67  }
    68  
    69  // UnimplementedStatsServiceServer must be embedded to have forward compatible implementations.
    70  type UnimplementedStatsServiceServer struct {
    71  }
    72  
    73  func (UnimplementedStatsServiceServer) GetStats(context.Context, *GetStatsRequest) (*GetStatsResponse, error) {
    74  	return nil, status.Errorf(codes.Unimplemented, "method GetStats not implemented")
    75  }
    76  func (UnimplementedStatsServiceServer) QueryStats(context.Context, *QueryStatsRequest) (*QueryStatsResponse, error) {
    77  	return nil, status.Errorf(codes.Unimplemented, "method QueryStats not implemented")
    78  }
    79  func (UnimplementedStatsServiceServer) GetSysStats(context.Context, *SysStatsRequest) (*SysStatsResponse, error) {
    80  	return nil, status.Errorf(codes.Unimplemented, "method GetSysStats not implemented")
    81  }
    82  func (UnimplementedStatsServiceServer) mustEmbedUnimplementedStatsServiceServer() {}
    83  
    84  // UnsafeStatsServiceServer may be embedded to opt out of forward compatibility for this service.
    85  // Use of this interface is not recommended, as added methods to StatsServiceServer will
    86  // result in compilation errors.
    87  type UnsafeStatsServiceServer interface {
    88  	mustEmbedUnimplementedStatsServiceServer()
    89  }
    90  
    91  func RegisterStatsServiceServer(s grpc.ServiceRegistrar, srv StatsServiceServer) {
    92  	s.RegisterService(&StatsService_ServiceDesc, srv)
    93  }
    94  
    95  func _StatsService_GetStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    96  	in := new(GetStatsRequest)
    97  	if err := dec(in); err != nil {
    98  		return nil, err
    99  	}
   100  	if interceptor == nil {
   101  		return srv.(StatsServiceServer).GetStats(ctx, in)
   102  	}
   103  	info := &grpc.UnaryServerInfo{
   104  		Server:     srv,
   105  		FullMethod: "/v2ray.core.app.stats.command.StatsService/GetStats",
   106  	}
   107  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   108  		return srv.(StatsServiceServer).GetStats(ctx, req.(*GetStatsRequest))
   109  	}
   110  	return interceptor(ctx, in, info, handler)
   111  }
   112  
   113  func _StatsService_QueryStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   114  	in := new(QueryStatsRequest)
   115  	if err := dec(in); err != nil {
   116  		return nil, err
   117  	}
   118  	if interceptor == nil {
   119  		return srv.(StatsServiceServer).QueryStats(ctx, in)
   120  	}
   121  	info := &grpc.UnaryServerInfo{
   122  		Server:     srv,
   123  		FullMethod: "/v2ray.core.app.stats.command.StatsService/QueryStats",
   124  	}
   125  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   126  		return srv.(StatsServiceServer).QueryStats(ctx, req.(*QueryStatsRequest))
   127  	}
   128  	return interceptor(ctx, in, info, handler)
   129  }
   130  
   131  func _StatsService_GetSysStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   132  	in := new(SysStatsRequest)
   133  	if err := dec(in); err != nil {
   134  		return nil, err
   135  	}
   136  	if interceptor == nil {
   137  		return srv.(StatsServiceServer).GetSysStats(ctx, in)
   138  	}
   139  	info := &grpc.UnaryServerInfo{
   140  		Server:     srv,
   141  		FullMethod: "/v2ray.core.app.stats.command.StatsService/GetSysStats",
   142  	}
   143  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   144  		return srv.(StatsServiceServer).GetSysStats(ctx, req.(*SysStatsRequest))
   145  	}
   146  	return interceptor(ctx, in, info, handler)
   147  }
   148  
   149  // StatsService_ServiceDesc is the grpc.ServiceDesc for StatsService service.
   150  // It's only intended for direct use with grpc.RegisterService,
   151  // and not to be introspected or modified (even as a copy)
   152  var StatsService_ServiceDesc = grpc.ServiceDesc{
   153  	ServiceName: "v2ray.core.app.stats.command.StatsService",
   154  	HandlerType: (*StatsServiceServer)(nil),
   155  	Methods: []grpc.MethodDesc{
   156  		{
   157  			MethodName: "GetStats",
   158  			Handler:    _StatsService_GetStats_Handler,
   159  		},
   160  		{
   161  			MethodName: "QueryStats",
   162  			Handler:    _StatsService_QueryStats_Handler,
   163  		},
   164  		{
   165  			MethodName: "GetSysStats",
   166  			Handler:    _StatsService_GetSysStats_Handler,
   167  		},
   168  	},
   169  	Streams:  []grpc.StreamDesc{},
   170  	Metadata: "app/stats/command/command.proto",
   171  }