command_grpc.pb.go 7.4 KB

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