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