command_grpc.pb.go 7.2 KB

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