command_grpc.pb.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. package command
  2. import (
  3. context "context"
  4. grpc "google.golang.org/grpc"
  5. codes "google.golang.org/grpc/codes"
  6. status "google.golang.org/grpc/status"
  7. )
  8. // This is a compile-time assertion to ensure that this generated file
  9. // is compatible with the grpc package it is being compiled against.
  10. // Requires gRPC-Go v1.32.0 or later.
  11. const _ = grpc.SupportPackageIsVersion7
  12. // HandlerServiceClient is the client API for HandlerService service.
  13. //
  14. // 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.
  15. type HandlerServiceClient interface {
  16. AddInbound(ctx context.Context, in *AddInboundRequest, opts ...grpc.CallOption) (*AddInboundResponse, error)
  17. RemoveInbound(ctx context.Context, in *RemoveInboundRequest, opts ...grpc.CallOption) (*RemoveInboundResponse, error)
  18. AlterInbound(ctx context.Context, in *AlterInboundRequest, opts ...grpc.CallOption) (*AlterInboundResponse, error)
  19. AddOutbound(ctx context.Context, in *AddOutboundRequest, opts ...grpc.CallOption) (*AddOutboundResponse, error)
  20. RemoveOutbound(ctx context.Context, in *RemoveOutboundRequest, opts ...grpc.CallOption) (*RemoveOutboundResponse, error)
  21. AlterOutbound(ctx context.Context, in *AlterOutboundRequest, opts ...grpc.CallOption) (*AlterOutboundResponse, error)
  22. }
  23. type handlerServiceClient struct {
  24. cc grpc.ClientConnInterface
  25. }
  26. func NewHandlerServiceClient(cc grpc.ClientConnInterface) HandlerServiceClient {
  27. return &handlerServiceClient{cc}
  28. }
  29. func (c *handlerServiceClient) AddInbound(ctx context.Context, in *AddInboundRequest, opts ...grpc.CallOption) (*AddInboundResponse, error) {
  30. out := new(AddInboundResponse)
  31. err := c.cc.Invoke(ctx, "/v2ray.core.app.proxyman.command.HandlerService/AddInbound", in, out, opts...)
  32. if err != nil {
  33. return nil, err
  34. }
  35. return out, nil
  36. }
  37. func (c *handlerServiceClient) RemoveInbound(ctx context.Context, in *RemoveInboundRequest, opts ...grpc.CallOption) (*RemoveInboundResponse, error) {
  38. out := new(RemoveInboundResponse)
  39. err := c.cc.Invoke(ctx, "/v2ray.core.app.proxyman.command.HandlerService/RemoveInbound", in, out, opts...)
  40. if err != nil {
  41. return nil, err
  42. }
  43. return out, nil
  44. }
  45. func (c *handlerServiceClient) AlterInbound(ctx context.Context, in *AlterInboundRequest, opts ...grpc.CallOption) (*AlterInboundResponse, error) {
  46. out := new(AlterInboundResponse)
  47. err := c.cc.Invoke(ctx, "/v2ray.core.app.proxyman.command.HandlerService/AlterInbound", in, out, opts...)
  48. if err != nil {
  49. return nil, err
  50. }
  51. return out, nil
  52. }
  53. func (c *handlerServiceClient) AddOutbound(ctx context.Context, in *AddOutboundRequest, opts ...grpc.CallOption) (*AddOutboundResponse, error) {
  54. out := new(AddOutboundResponse)
  55. err := c.cc.Invoke(ctx, "/v2ray.core.app.proxyman.command.HandlerService/AddOutbound", in, out, opts...)
  56. if err != nil {
  57. return nil, err
  58. }
  59. return out, nil
  60. }
  61. func (c *handlerServiceClient) RemoveOutbound(ctx context.Context, in *RemoveOutboundRequest, opts ...grpc.CallOption) (*RemoveOutboundResponse, error) {
  62. out := new(RemoveOutboundResponse)
  63. err := c.cc.Invoke(ctx, "/v2ray.core.app.proxyman.command.HandlerService/RemoveOutbound", in, out, opts...)
  64. if err != nil {
  65. return nil, err
  66. }
  67. return out, nil
  68. }
  69. func (c *handlerServiceClient) AlterOutbound(ctx context.Context, in *AlterOutboundRequest, opts ...grpc.CallOption) (*AlterOutboundResponse, error) {
  70. out := new(AlterOutboundResponse)
  71. err := c.cc.Invoke(ctx, "/v2ray.core.app.proxyman.command.HandlerService/AlterOutbound", in, out, opts...)
  72. if err != nil {
  73. return nil, err
  74. }
  75. return out, nil
  76. }
  77. // HandlerServiceServer is the server API for HandlerService service.
  78. // All implementations must embed UnimplementedHandlerServiceServer
  79. // for forward compatibility
  80. type HandlerServiceServer interface {
  81. AddInbound(context.Context, *AddInboundRequest) (*AddInboundResponse, error)
  82. RemoveInbound(context.Context, *RemoveInboundRequest) (*RemoveInboundResponse, error)
  83. AlterInbound(context.Context, *AlterInboundRequest) (*AlterInboundResponse, error)
  84. AddOutbound(context.Context, *AddOutboundRequest) (*AddOutboundResponse, error)
  85. RemoveOutbound(context.Context, *RemoveOutboundRequest) (*RemoveOutboundResponse, error)
  86. AlterOutbound(context.Context, *AlterOutboundRequest) (*AlterOutboundResponse, error)
  87. mustEmbedUnimplementedHandlerServiceServer()
  88. }
  89. // UnimplementedHandlerServiceServer must be embedded to have forward compatible implementations.
  90. type UnimplementedHandlerServiceServer struct {
  91. }
  92. func (UnimplementedHandlerServiceServer) AddInbound(context.Context, *AddInboundRequest) (*AddInboundResponse, error) {
  93. return nil, status.Errorf(codes.Unimplemented, "method AddInbound not implemented")
  94. }
  95. func (UnimplementedHandlerServiceServer) RemoveInbound(context.Context, *RemoveInboundRequest) (*RemoveInboundResponse, error) {
  96. return nil, status.Errorf(codes.Unimplemented, "method RemoveInbound not implemented")
  97. }
  98. func (UnimplementedHandlerServiceServer) AlterInbound(context.Context, *AlterInboundRequest) (*AlterInboundResponse, error) {
  99. return nil, status.Errorf(codes.Unimplemented, "method AlterInbound not implemented")
  100. }
  101. func (UnimplementedHandlerServiceServer) AddOutbound(context.Context, *AddOutboundRequest) (*AddOutboundResponse, error) {
  102. return nil, status.Errorf(codes.Unimplemented, "method AddOutbound not implemented")
  103. }
  104. func (UnimplementedHandlerServiceServer) RemoveOutbound(context.Context, *RemoveOutboundRequest) (*RemoveOutboundResponse, error) {
  105. return nil, status.Errorf(codes.Unimplemented, "method RemoveOutbound not implemented")
  106. }
  107. func (UnimplementedHandlerServiceServer) AlterOutbound(context.Context, *AlterOutboundRequest) (*AlterOutboundResponse, error) {
  108. return nil, status.Errorf(codes.Unimplemented, "method AlterOutbound not implemented")
  109. }
  110. func (UnimplementedHandlerServiceServer) mustEmbedUnimplementedHandlerServiceServer() {}
  111. // UnsafeHandlerServiceServer may be embedded to opt out of forward compatibility for this service.
  112. // Use of this interface is not recommended, as added methods to HandlerServiceServer will
  113. // result in compilation errors.
  114. type UnsafeHandlerServiceServer interface {
  115. mustEmbedUnimplementedHandlerServiceServer()
  116. }
  117. func RegisterHandlerServiceServer(s grpc.ServiceRegistrar, srv HandlerServiceServer) {
  118. s.RegisterService(&HandlerService_ServiceDesc, srv)
  119. }
  120. func _HandlerService_AddInbound_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  121. in := new(AddInboundRequest)
  122. if err := dec(in); err != nil {
  123. return nil, err
  124. }
  125. if interceptor == nil {
  126. return srv.(HandlerServiceServer).AddInbound(ctx, in)
  127. }
  128. info := &grpc.UnaryServerInfo{
  129. Server: srv,
  130. FullMethod: "/v2ray.core.app.proxyman.command.HandlerService/AddInbound",
  131. }
  132. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  133. return srv.(HandlerServiceServer).AddInbound(ctx, req.(*AddInboundRequest))
  134. }
  135. return interceptor(ctx, in, info, handler)
  136. }
  137. func _HandlerService_RemoveInbound_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  138. in := new(RemoveInboundRequest)
  139. if err := dec(in); err != nil {
  140. return nil, err
  141. }
  142. if interceptor == nil {
  143. return srv.(HandlerServiceServer).RemoveInbound(ctx, in)
  144. }
  145. info := &grpc.UnaryServerInfo{
  146. Server: srv,
  147. FullMethod: "/v2ray.core.app.proxyman.command.HandlerService/RemoveInbound",
  148. }
  149. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  150. return srv.(HandlerServiceServer).RemoveInbound(ctx, req.(*RemoveInboundRequest))
  151. }
  152. return interceptor(ctx, in, info, handler)
  153. }
  154. func _HandlerService_AlterInbound_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  155. in := new(AlterInboundRequest)
  156. if err := dec(in); err != nil {
  157. return nil, err
  158. }
  159. if interceptor == nil {
  160. return srv.(HandlerServiceServer).AlterInbound(ctx, in)
  161. }
  162. info := &grpc.UnaryServerInfo{
  163. Server: srv,
  164. FullMethod: "/v2ray.core.app.proxyman.command.HandlerService/AlterInbound",
  165. }
  166. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  167. return srv.(HandlerServiceServer).AlterInbound(ctx, req.(*AlterInboundRequest))
  168. }
  169. return interceptor(ctx, in, info, handler)
  170. }
  171. func _HandlerService_AddOutbound_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  172. in := new(AddOutboundRequest)
  173. if err := dec(in); err != nil {
  174. return nil, err
  175. }
  176. if interceptor == nil {
  177. return srv.(HandlerServiceServer).AddOutbound(ctx, in)
  178. }
  179. info := &grpc.UnaryServerInfo{
  180. Server: srv,
  181. FullMethod: "/v2ray.core.app.proxyman.command.HandlerService/AddOutbound",
  182. }
  183. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  184. return srv.(HandlerServiceServer).AddOutbound(ctx, req.(*AddOutboundRequest))
  185. }
  186. return interceptor(ctx, in, info, handler)
  187. }
  188. func _HandlerService_RemoveOutbound_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  189. in := new(RemoveOutboundRequest)
  190. if err := dec(in); err != nil {
  191. return nil, err
  192. }
  193. if interceptor == nil {
  194. return srv.(HandlerServiceServer).RemoveOutbound(ctx, in)
  195. }
  196. info := &grpc.UnaryServerInfo{
  197. Server: srv,
  198. FullMethod: "/v2ray.core.app.proxyman.command.HandlerService/RemoveOutbound",
  199. }
  200. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  201. return srv.(HandlerServiceServer).RemoveOutbound(ctx, req.(*RemoveOutboundRequest))
  202. }
  203. return interceptor(ctx, in, info, handler)
  204. }
  205. func _HandlerService_AlterOutbound_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  206. in := new(AlterOutboundRequest)
  207. if err := dec(in); err != nil {
  208. return nil, err
  209. }
  210. if interceptor == nil {
  211. return srv.(HandlerServiceServer).AlterOutbound(ctx, in)
  212. }
  213. info := &grpc.UnaryServerInfo{
  214. Server: srv,
  215. FullMethod: "/v2ray.core.app.proxyman.command.HandlerService/AlterOutbound",
  216. }
  217. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  218. return srv.(HandlerServiceServer).AlterOutbound(ctx, req.(*AlterOutboundRequest))
  219. }
  220. return interceptor(ctx, in, info, handler)
  221. }
  222. // HandlerService_ServiceDesc is the grpc.ServiceDesc for HandlerService service.
  223. // It's only intended for direct use with grpc.RegisterService,
  224. // and not to be introspected or modified (even as a copy)
  225. var HandlerService_ServiceDesc = grpc.ServiceDesc{
  226. ServiceName: "v2ray.core.app.proxyman.command.HandlerService",
  227. HandlerType: (*HandlerServiceServer)(nil),
  228. Methods: []grpc.MethodDesc{
  229. {
  230. MethodName: "AddInbound",
  231. Handler: _HandlerService_AddInbound_Handler,
  232. },
  233. {
  234. MethodName: "RemoveInbound",
  235. Handler: _HandlerService_RemoveInbound_Handler,
  236. },
  237. {
  238. MethodName: "AlterInbound",
  239. Handler: _HandlerService_AlterInbound_Handler,
  240. },
  241. {
  242. MethodName: "AddOutbound",
  243. Handler: _HandlerService_AddOutbound_Handler,
  244. },
  245. {
  246. MethodName: "RemoveOutbound",
  247. Handler: _HandlerService_RemoveOutbound_Handler,
  248. },
  249. {
  250. MethodName: "AlterOutbound",
  251. Handler: _HandlerService_AlterOutbound_Handler,
  252. },
  253. },
  254. Streams: []grpc.StreamDesc{},
  255. Metadata: "app/proxyman/command/command.proto",
  256. }