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