github.com/imannamdari/v2ray-core/v5@v5.0.5/app/log/command/config_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 // LoggerServiceClient is the client API for LoggerService 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 LoggerServiceClient interface { 19 RestartLogger(ctx context.Context, in *RestartLoggerRequest, opts ...grpc.CallOption) (*RestartLoggerResponse, error) 20 // Unstable interface 21 FollowLog(ctx context.Context, in *FollowLogRequest, opts ...grpc.CallOption) (LoggerService_FollowLogClient, error) 22 } 23 24 type loggerServiceClient struct { 25 cc grpc.ClientConnInterface 26 } 27 28 func NewLoggerServiceClient(cc grpc.ClientConnInterface) LoggerServiceClient { 29 return &loggerServiceClient{cc} 30 } 31 32 func (c *loggerServiceClient) RestartLogger(ctx context.Context, in *RestartLoggerRequest, opts ...grpc.CallOption) (*RestartLoggerResponse, error) { 33 out := new(RestartLoggerResponse) 34 err := c.cc.Invoke(ctx, "/v2ray.core.app.log.command.LoggerService/RestartLogger", in, out, opts...) 35 if err != nil { 36 return nil, err 37 } 38 return out, nil 39 } 40 41 func (c *loggerServiceClient) FollowLog(ctx context.Context, in *FollowLogRequest, opts ...grpc.CallOption) (LoggerService_FollowLogClient, error) { 42 stream, err := c.cc.NewStream(ctx, &LoggerService_ServiceDesc.Streams[0], "/v2ray.core.app.log.command.LoggerService/FollowLog", opts...) 43 if err != nil { 44 return nil, err 45 } 46 x := &loggerServiceFollowLogClient{stream} 47 if err := x.ClientStream.SendMsg(in); err != nil { 48 return nil, err 49 } 50 if err := x.ClientStream.CloseSend(); err != nil { 51 return nil, err 52 } 53 return x, nil 54 } 55 56 type LoggerService_FollowLogClient interface { 57 Recv() (*FollowLogResponse, error) 58 grpc.ClientStream 59 } 60 61 type loggerServiceFollowLogClient struct { 62 grpc.ClientStream 63 } 64 65 func (x *loggerServiceFollowLogClient) Recv() (*FollowLogResponse, error) { 66 m := new(FollowLogResponse) 67 if err := x.ClientStream.RecvMsg(m); err != nil { 68 return nil, err 69 } 70 return m, nil 71 } 72 73 // LoggerServiceServer is the server API for LoggerService service. 74 // All implementations must embed UnimplementedLoggerServiceServer 75 // for forward compatibility 76 type LoggerServiceServer interface { 77 RestartLogger(context.Context, *RestartLoggerRequest) (*RestartLoggerResponse, error) 78 // Unstable interface 79 FollowLog(*FollowLogRequest, LoggerService_FollowLogServer) error 80 mustEmbedUnimplementedLoggerServiceServer() 81 } 82 83 // UnimplementedLoggerServiceServer must be embedded to have forward compatible implementations. 84 type UnimplementedLoggerServiceServer struct { 85 } 86 87 func (UnimplementedLoggerServiceServer) RestartLogger(context.Context, *RestartLoggerRequest) (*RestartLoggerResponse, error) { 88 return nil, status.Errorf(codes.Unimplemented, "method RestartLogger not implemented") 89 } 90 func (UnimplementedLoggerServiceServer) FollowLog(*FollowLogRequest, LoggerService_FollowLogServer) error { 91 return status.Errorf(codes.Unimplemented, "method FollowLog not implemented") 92 } 93 func (UnimplementedLoggerServiceServer) mustEmbedUnimplementedLoggerServiceServer() {} 94 95 // UnsafeLoggerServiceServer may be embedded to opt out of forward compatibility for this service. 96 // Use of this interface is not recommended, as added methods to LoggerServiceServer will 97 // result in compilation errors. 98 type UnsafeLoggerServiceServer interface { 99 mustEmbedUnimplementedLoggerServiceServer() 100 } 101 102 func RegisterLoggerServiceServer(s grpc.ServiceRegistrar, srv LoggerServiceServer) { 103 s.RegisterService(&LoggerService_ServiceDesc, srv) 104 } 105 106 func _LoggerService_RestartLogger_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 107 in := new(RestartLoggerRequest) 108 if err := dec(in); err != nil { 109 return nil, err 110 } 111 if interceptor == nil { 112 return srv.(LoggerServiceServer).RestartLogger(ctx, in) 113 } 114 info := &grpc.UnaryServerInfo{ 115 Server: srv, 116 FullMethod: "/v2ray.core.app.log.command.LoggerService/RestartLogger", 117 } 118 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 119 return srv.(LoggerServiceServer).RestartLogger(ctx, req.(*RestartLoggerRequest)) 120 } 121 return interceptor(ctx, in, info, handler) 122 } 123 124 func _LoggerService_FollowLog_Handler(srv interface{}, stream grpc.ServerStream) error { 125 m := new(FollowLogRequest) 126 if err := stream.RecvMsg(m); err != nil { 127 return err 128 } 129 return srv.(LoggerServiceServer).FollowLog(m, &loggerServiceFollowLogServer{stream}) 130 } 131 132 type LoggerService_FollowLogServer interface { 133 Send(*FollowLogResponse) error 134 grpc.ServerStream 135 } 136 137 type loggerServiceFollowLogServer struct { 138 grpc.ServerStream 139 } 140 141 func (x *loggerServiceFollowLogServer) Send(m *FollowLogResponse) error { 142 return x.ServerStream.SendMsg(m) 143 } 144 145 // LoggerService_ServiceDesc is the grpc.ServiceDesc for LoggerService service. 146 // It's only intended for direct use with grpc.RegisterService, 147 // and not to be introspected or modified (even as a copy) 148 var LoggerService_ServiceDesc = grpc.ServiceDesc{ 149 ServiceName: "v2ray.core.app.log.command.LoggerService", 150 HandlerType: (*LoggerServiceServer)(nil), 151 Methods: []grpc.MethodDesc{ 152 { 153 MethodName: "RestartLogger", 154 Handler: _LoggerService_RestartLogger_Handler, 155 }, 156 }, 157 Streams: []grpc.StreamDesc{ 158 { 159 StreamName: "FollowLog", 160 Handler: _LoggerService_FollowLog_Handler, 161 ServerStreams: true, 162 }, 163 }, 164 Metadata: "app/log/command/config.proto", 165 }