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