command_grpc.pb.go 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. // InstanceManagementServiceClient is the client API for InstanceManagementService 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 InstanceManagementServiceClient interface {
  16. ListInstance(ctx context.Context, in *ListInstanceReq, opts ...grpc.CallOption) (*ListInstanceResp, error)
  17. AddInstance(ctx context.Context, in *AddInstanceReq, opts ...grpc.CallOption) (*AddInstanceResp, error)
  18. StartInstance(ctx context.Context, in *StartInstanceReq, opts ...grpc.CallOption) (*StartInstanceResp, error)
  19. }
  20. type instanceManagementServiceClient struct {
  21. cc grpc.ClientConnInterface
  22. }
  23. func NewInstanceManagementServiceClient(cc grpc.ClientConnInterface) InstanceManagementServiceClient {
  24. return &instanceManagementServiceClient{cc}
  25. }
  26. func (c *instanceManagementServiceClient) ListInstance(ctx context.Context, in *ListInstanceReq, opts ...grpc.CallOption) (*ListInstanceResp, error) {
  27. out := new(ListInstanceResp)
  28. err := c.cc.Invoke(ctx, "/v2ray.core.app.instman.command.InstanceManagementService/ListInstance", in, out, opts...)
  29. if err != nil {
  30. return nil, err
  31. }
  32. return out, nil
  33. }
  34. func (c *instanceManagementServiceClient) AddInstance(ctx context.Context, in *AddInstanceReq, opts ...grpc.CallOption) (*AddInstanceResp, error) {
  35. out := new(AddInstanceResp)
  36. err := c.cc.Invoke(ctx, "/v2ray.core.app.instman.command.InstanceManagementService/AddInstance", in, out, opts...)
  37. if err != nil {
  38. return nil, err
  39. }
  40. return out, nil
  41. }
  42. func (c *instanceManagementServiceClient) StartInstance(ctx context.Context, in *StartInstanceReq, opts ...grpc.CallOption) (*StartInstanceResp, error) {
  43. out := new(StartInstanceResp)
  44. err := c.cc.Invoke(ctx, "/v2ray.core.app.instman.command.InstanceManagementService/StartInstance", in, out, opts...)
  45. if err != nil {
  46. return nil, err
  47. }
  48. return out, nil
  49. }
  50. // InstanceManagementServiceServer is the server API for InstanceManagementService service.
  51. // All implementations must embed UnimplementedInstanceManagementServiceServer
  52. // for forward compatibility
  53. type InstanceManagementServiceServer interface {
  54. ListInstance(context.Context, *ListInstanceReq) (*ListInstanceResp, error)
  55. AddInstance(context.Context, *AddInstanceReq) (*AddInstanceResp, error)
  56. StartInstance(context.Context, *StartInstanceReq) (*StartInstanceResp, error)
  57. mustEmbedUnimplementedInstanceManagementServiceServer()
  58. }
  59. // UnimplementedInstanceManagementServiceServer must be embedded to have forward compatible implementations.
  60. type UnimplementedInstanceManagementServiceServer struct {
  61. }
  62. func (UnimplementedInstanceManagementServiceServer) ListInstance(context.Context, *ListInstanceReq) (*ListInstanceResp, error) {
  63. return nil, status.Errorf(codes.Unimplemented, "method ListInstance not implemented")
  64. }
  65. func (UnimplementedInstanceManagementServiceServer) AddInstance(context.Context, *AddInstanceReq) (*AddInstanceResp, error) {
  66. return nil, status.Errorf(codes.Unimplemented, "method AddInstance not implemented")
  67. }
  68. func (UnimplementedInstanceManagementServiceServer) StartInstance(context.Context, *StartInstanceReq) (*StartInstanceResp, error) {
  69. return nil, status.Errorf(codes.Unimplemented, "method StartInstance not implemented")
  70. }
  71. func (UnimplementedInstanceManagementServiceServer) mustEmbedUnimplementedInstanceManagementServiceServer() {
  72. }
  73. // UnsafeInstanceManagementServiceServer may be embedded to opt out of forward compatibility for this service.
  74. // Use of this interface is not recommended, as added methods to InstanceManagementServiceServer will
  75. // result in compilation errors.
  76. type UnsafeInstanceManagementServiceServer interface {
  77. mustEmbedUnimplementedInstanceManagementServiceServer()
  78. }
  79. func RegisterInstanceManagementServiceServer(s grpc.ServiceRegistrar, srv InstanceManagementServiceServer) {
  80. s.RegisterService(&InstanceManagementService_ServiceDesc, srv)
  81. }
  82. func _InstanceManagementService_ListInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  83. in := new(ListInstanceReq)
  84. if err := dec(in); err != nil {
  85. return nil, err
  86. }
  87. if interceptor == nil {
  88. return srv.(InstanceManagementServiceServer).ListInstance(ctx, in)
  89. }
  90. info := &grpc.UnaryServerInfo{
  91. Server: srv,
  92. FullMethod: "/v2ray.core.app.instman.command.InstanceManagementService/ListInstance",
  93. }
  94. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  95. return srv.(InstanceManagementServiceServer).ListInstance(ctx, req.(*ListInstanceReq))
  96. }
  97. return interceptor(ctx, in, info, handler)
  98. }
  99. func _InstanceManagementService_AddInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  100. in := new(AddInstanceReq)
  101. if err := dec(in); err != nil {
  102. return nil, err
  103. }
  104. if interceptor == nil {
  105. return srv.(InstanceManagementServiceServer).AddInstance(ctx, in)
  106. }
  107. info := &grpc.UnaryServerInfo{
  108. Server: srv,
  109. FullMethod: "/v2ray.core.app.instman.command.InstanceManagementService/AddInstance",
  110. }
  111. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  112. return srv.(InstanceManagementServiceServer).AddInstance(ctx, req.(*AddInstanceReq))
  113. }
  114. return interceptor(ctx, in, info, handler)
  115. }
  116. func _InstanceManagementService_StartInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  117. in := new(StartInstanceReq)
  118. if err := dec(in); err != nil {
  119. return nil, err
  120. }
  121. if interceptor == nil {
  122. return srv.(InstanceManagementServiceServer).StartInstance(ctx, in)
  123. }
  124. info := &grpc.UnaryServerInfo{
  125. Server: srv,
  126. FullMethod: "/v2ray.core.app.instman.command.InstanceManagementService/StartInstance",
  127. }
  128. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  129. return srv.(InstanceManagementServiceServer).StartInstance(ctx, req.(*StartInstanceReq))
  130. }
  131. return interceptor(ctx, in, info, handler)
  132. }
  133. // InstanceManagementService_ServiceDesc is the grpc.ServiceDesc for InstanceManagementService service.
  134. // It's only intended for direct use with grpc.RegisterService,
  135. // and not to be introspected or modified (even as a copy)
  136. var InstanceManagementService_ServiceDesc = grpc.ServiceDesc{
  137. ServiceName: "v2ray.core.app.instman.command.InstanceManagementService",
  138. HandlerType: (*InstanceManagementServiceServer)(nil),
  139. Methods: []grpc.MethodDesc{
  140. {
  141. MethodName: "ListInstance",
  142. Handler: _InstanceManagementService_ListInstance_Handler,
  143. },
  144. {
  145. MethodName: "AddInstance",
  146. Handler: _InstanceManagementService_AddInstance_Handler,
  147. },
  148. {
  149. MethodName: "StartInstance",
  150. Handler: _InstanceManagementService_StartInstance_Handler,
  151. },
  152. },
  153. Streams: []grpc.StreamDesc{},
  154. Metadata: "app/instman/command/command.proto",
  155. }