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