command_grpc.pb.go 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. ObservatoryService_GetOutboundStatus_FullMethodName = "/v2ray.core.app.observatory.command.ObservatoryService/GetOutboundStatus"
  14. )
  15. // ObservatoryServiceClient is the client API for ObservatoryService 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 ObservatoryServiceClient interface {
  19. GetOutboundStatus(ctx context.Context, in *GetOutboundStatusRequest, opts ...grpc.CallOption) (*GetOutboundStatusResponse, error)
  20. }
  21. type observatoryServiceClient struct {
  22. cc grpc.ClientConnInterface
  23. }
  24. func NewObservatoryServiceClient(cc grpc.ClientConnInterface) ObservatoryServiceClient {
  25. return &observatoryServiceClient{cc}
  26. }
  27. func (c *observatoryServiceClient) GetOutboundStatus(ctx context.Context, in *GetOutboundStatusRequest, opts ...grpc.CallOption) (*GetOutboundStatusResponse, error) {
  28. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  29. out := new(GetOutboundStatusResponse)
  30. err := c.cc.Invoke(ctx, ObservatoryService_GetOutboundStatus_FullMethodName, in, out, cOpts...)
  31. if err != nil {
  32. return nil, err
  33. }
  34. return out, nil
  35. }
  36. // ObservatoryServiceServer is the server API for ObservatoryService service.
  37. // All implementations must embed UnimplementedObservatoryServiceServer
  38. // for forward compatibility.
  39. type ObservatoryServiceServer interface {
  40. GetOutboundStatus(context.Context, *GetOutboundStatusRequest) (*GetOutboundStatusResponse, error)
  41. mustEmbedUnimplementedObservatoryServiceServer()
  42. }
  43. // UnimplementedObservatoryServiceServer must be embedded to have
  44. // forward compatible implementations.
  45. //
  46. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  47. // pointer dereference when methods are called.
  48. type UnimplementedObservatoryServiceServer struct{}
  49. func (UnimplementedObservatoryServiceServer) GetOutboundStatus(context.Context, *GetOutboundStatusRequest) (*GetOutboundStatusResponse, error) {
  50. return nil, status.Errorf(codes.Unimplemented, "method GetOutboundStatus not implemented")
  51. }
  52. func (UnimplementedObservatoryServiceServer) mustEmbedUnimplementedObservatoryServiceServer() {}
  53. func (UnimplementedObservatoryServiceServer) testEmbeddedByValue() {}
  54. // UnsafeObservatoryServiceServer may be embedded to opt out of forward compatibility for this service.
  55. // Use of this interface is not recommended, as added methods to ObservatoryServiceServer will
  56. // result in compilation errors.
  57. type UnsafeObservatoryServiceServer interface {
  58. mustEmbedUnimplementedObservatoryServiceServer()
  59. }
  60. func RegisterObservatoryServiceServer(s grpc.ServiceRegistrar, srv ObservatoryServiceServer) {
  61. // If the following call pancis, it indicates UnimplementedObservatoryServiceServer was
  62. // embedded by pointer and is nil. This will cause panics if an
  63. // unimplemented method is ever invoked, so we test this at initialization
  64. // time to prevent it from happening at runtime later due to I/O.
  65. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  66. t.testEmbeddedByValue()
  67. }
  68. s.RegisterService(&ObservatoryService_ServiceDesc, srv)
  69. }
  70. func _ObservatoryService_GetOutboundStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  71. in := new(GetOutboundStatusRequest)
  72. if err := dec(in); err != nil {
  73. return nil, err
  74. }
  75. if interceptor == nil {
  76. return srv.(ObservatoryServiceServer).GetOutboundStatus(ctx, in)
  77. }
  78. info := &grpc.UnaryServerInfo{
  79. Server: srv,
  80. FullMethod: ObservatoryService_GetOutboundStatus_FullMethodName,
  81. }
  82. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  83. return srv.(ObservatoryServiceServer).GetOutboundStatus(ctx, req.(*GetOutboundStatusRequest))
  84. }
  85. return interceptor(ctx, in, info, handler)
  86. }
  87. // ObservatoryService_ServiceDesc is the grpc.ServiceDesc for ObservatoryService service.
  88. // It's only intended for direct use with grpc.RegisterService,
  89. // and not to be introspected or modified (even as a copy)
  90. var ObservatoryService_ServiceDesc = grpc.ServiceDesc{
  91. ServiceName: "v2ray.core.app.observatory.command.ObservatoryService",
  92. HandlerType: (*ObservatoryServiceServer)(nil),
  93. Methods: []grpc.MethodDesc{
  94. {
  95. MethodName: "GetOutboundStatus",
  96. Handler: _ObservatoryService_GetOutboundStatus_Handler,
  97. },
  98. },
  99. Streams: []grpc.StreamDesc{},
  100. Metadata: "app/observatory/command/command.proto",
  101. }