command_grpc.pb.go 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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.64.0 or later.
  11. const _ = grpc.SupportPackageIsVersion9
  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. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  33. out := new(ListInstanceResp)
  34. err := c.cc.Invoke(ctx, InstanceManagementService_ListInstance_FullMethodName, in, out, cOpts...)
  35. if err != nil {
  36. return nil, err
  37. }
  38. return out, nil
  39. }
  40. func (c *instanceManagementServiceClient) AddInstance(ctx context.Context, in *AddInstanceReq, opts ...grpc.CallOption) (*AddInstanceResp, error) {
  41. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  42. out := new(AddInstanceResp)
  43. err := c.cc.Invoke(ctx, InstanceManagementService_AddInstance_FullMethodName, in, out, cOpts...)
  44. if err != nil {
  45. return nil, err
  46. }
  47. return out, nil
  48. }
  49. func (c *instanceManagementServiceClient) StartInstance(ctx context.Context, in *StartInstanceReq, opts ...grpc.CallOption) (*StartInstanceResp, error) {
  50. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  51. out := new(StartInstanceResp)
  52. err := c.cc.Invoke(ctx, InstanceManagementService_StartInstance_FullMethodName, in, out, cOpts...)
  53. if err != nil {
  54. return nil, err
  55. }
  56. return out, nil
  57. }
  58. // InstanceManagementServiceServer is the server API for InstanceManagementService service.
  59. // All implementations must embed UnimplementedInstanceManagementServiceServer
  60. // for forward compatibility.
  61. type InstanceManagementServiceServer interface {
  62. ListInstance(context.Context, *ListInstanceReq) (*ListInstanceResp, error)
  63. AddInstance(context.Context, *AddInstanceReq) (*AddInstanceResp, error)
  64. StartInstance(context.Context, *StartInstanceReq) (*StartInstanceResp, error)
  65. mustEmbedUnimplementedInstanceManagementServiceServer()
  66. }
  67. // UnimplementedInstanceManagementServiceServer must be embedded to have
  68. // forward compatible implementations.
  69. //
  70. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  71. // pointer dereference when methods are called.
  72. type UnimplementedInstanceManagementServiceServer struct{}
  73. func (UnimplementedInstanceManagementServiceServer) ListInstance(context.Context, *ListInstanceReq) (*ListInstanceResp, error) {
  74. return nil, status.Errorf(codes.Unimplemented, "method ListInstance not implemented")
  75. }
  76. func (UnimplementedInstanceManagementServiceServer) AddInstance(context.Context, *AddInstanceReq) (*AddInstanceResp, error) {
  77. return nil, status.Errorf(codes.Unimplemented, "method AddInstance not implemented")
  78. }
  79. func (UnimplementedInstanceManagementServiceServer) StartInstance(context.Context, *StartInstanceReq) (*StartInstanceResp, error) {
  80. return nil, status.Errorf(codes.Unimplemented, "method StartInstance not implemented")
  81. }
  82. func (UnimplementedInstanceManagementServiceServer) mustEmbedUnimplementedInstanceManagementServiceServer() {
  83. }
  84. func (UnimplementedInstanceManagementServiceServer) testEmbeddedByValue() {}
  85. // UnsafeInstanceManagementServiceServer may be embedded to opt out of forward compatibility for this service.
  86. // Use of this interface is not recommended, as added methods to InstanceManagementServiceServer will
  87. // result in compilation errors.
  88. type UnsafeInstanceManagementServiceServer interface {
  89. mustEmbedUnimplementedInstanceManagementServiceServer()
  90. }
  91. func RegisterInstanceManagementServiceServer(s grpc.ServiceRegistrar, srv InstanceManagementServiceServer) {
  92. // If the following call pancis, it indicates UnimplementedInstanceManagementServiceServer was
  93. // embedded by pointer and is nil. This will cause panics if an
  94. // unimplemented method is ever invoked, so we test this at initialization
  95. // time to prevent it from happening at runtime later due to I/O.
  96. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  97. t.testEmbeddedByValue()
  98. }
  99. s.RegisterService(&InstanceManagementService_ServiceDesc, srv)
  100. }
  101. func _InstanceManagementService_ListInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  102. in := new(ListInstanceReq)
  103. if err := dec(in); err != nil {
  104. return nil, err
  105. }
  106. if interceptor == nil {
  107. return srv.(InstanceManagementServiceServer).ListInstance(ctx, in)
  108. }
  109. info := &grpc.UnaryServerInfo{
  110. Server: srv,
  111. FullMethod: InstanceManagementService_ListInstance_FullMethodName,
  112. }
  113. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  114. return srv.(InstanceManagementServiceServer).ListInstance(ctx, req.(*ListInstanceReq))
  115. }
  116. return interceptor(ctx, in, info, handler)
  117. }
  118. func _InstanceManagementService_AddInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  119. in := new(AddInstanceReq)
  120. if err := dec(in); err != nil {
  121. return nil, err
  122. }
  123. if interceptor == nil {
  124. return srv.(InstanceManagementServiceServer).AddInstance(ctx, in)
  125. }
  126. info := &grpc.UnaryServerInfo{
  127. Server: srv,
  128. FullMethod: InstanceManagementService_AddInstance_FullMethodName,
  129. }
  130. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  131. return srv.(InstanceManagementServiceServer).AddInstance(ctx, req.(*AddInstanceReq))
  132. }
  133. return interceptor(ctx, in, info, handler)
  134. }
  135. func _InstanceManagementService_StartInstance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  136. in := new(StartInstanceReq)
  137. if err := dec(in); err != nil {
  138. return nil, err
  139. }
  140. if interceptor == nil {
  141. return srv.(InstanceManagementServiceServer).StartInstance(ctx, in)
  142. }
  143. info := &grpc.UnaryServerInfo{
  144. Server: srv,
  145. FullMethod: InstanceManagementService_StartInstance_FullMethodName,
  146. }
  147. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  148. return srv.(InstanceManagementServiceServer).StartInstance(ctx, req.(*StartInstanceReq))
  149. }
  150. return interceptor(ctx, in, info, handler)
  151. }
  152. // InstanceManagementService_ServiceDesc is the grpc.ServiceDesc for InstanceManagementService service.
  153. // It's only intended for direct use with grpc.RegisterService,
  154. // and not to be introspected or modified (even as a copy)
  155. var InstanceManagementService_ServiceDesc = grpc.ServiceDesc{
  156. ServiceName: "v2ray.core.app.instman.command.InstanceManagementService",
  157. HandlerType: (*InstanceManagementServiceServer)(nil),
  158. Methods: []grpc.MethodDesc{
  159. {
  160. MethodName: "ListInstance",
  161. Handler: _InstanceManagementService_ListInstance_Handler,
  162. },
  163. {
  164. MethodName: "AddInstance",
  165. Handler: _InstanceManagementService_AddInstance_Handler,
  166. },
  167. {
  168. MethodName: "StartInstance",
  169. Handler: _InstanceManagementService_StartInstance_Handler,
  170. },
  171. },
  172. Streams: []grpc.StreamDesc{},
  173. Metadata: "app/instman/command/command.proto",
  174. }