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