networkDiagnostic_grpc.pb.go 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.5.1
  4. // - protoc v5.28.2
  5. // source: networkDiagnostic.proto
  6. package networkdiagnostic
  7. import (
  8. context "context"
  9. grpc "google.golang.org/grpc"
  10. codes "google.golang.org/grpc/codes"
  11. status "google.golang.org/grpc/status"
  12. )
  13. // This is a compile-time assertion to ensure that this generated file
  14. // is compatible with the grpc package it is being compiled against.
  15. // Requires gRPC-Go v1.64.0 or later.
  16. const _ = grpc.SupportPackageIsVersion9
  17. const (
  18. NetworkDiagnosticService_NetworkLatencyProbe_FullMethodName = "/networkdiagnostic.NetworkDiagnosticService/NetworkLatencyProbe"
  19. )
  20. // NetworkDiagnosticServiceClient is the client API for NetworkDiagnosticService service.
  21. //
  22. // 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.
  23. type NetworkDiagnosticServiceClient interface {
  24. NetworkLatencyProbe(ctx context.Context, in *NetworkLatencyProbeRequest, opts ...grpc.CallOption) (*NetworkLatencyProbeReply, error)
  25. }
  26. type networkDiagnosticServiceClient struct {
  27. cc grpc.ClientConnInterface
  28. }
  29. func NewNetworkDiagnosticServiceClient(cc grpc.ClientConnInterface) NetworkDiagnosticServiceClient {
  30. return &networkDiagnosticServiceClient{cc}
  31. }
  32. func (c *networkDiagnosticServiceClient) NetworkLatencyProbe(ctx context.Context, in *NetworkLatencyProbeRequest, opts ...grpc.CallOption) (*NetworkLatencyProbeReply, error) {
  33. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  34. out := new(NetworkLatencyProbeReply)
  35. err := c.cc.Invoke(ctx, NetworkDiagnosticService_NetworkLatencyProbe_FullMethodName, in, out, cOpts...)
  36. if err != nil {
  37. return nil, err
  38. }
  39. return out, nil
  40. }
  41. // NetworkDiagnosticServiceServer is the server API for NetworkDiagnosticService service.
  42. // All implementations must embed UnimplementedNetworkDiagnosticServiceServer
  43. // for forward compatibility.
  44. type NetworkDiagnosticServiceServer interface {
  45. NetworkLatencyProbe(context.Context, *NetworkLatencyProbeRequest) (*NetworkLatencyProbeReply, error)
  46. mustEmbedUnimplementedNetworkDiagnosticServiceServer()
  47. }
  48. // UnimplementedNetworkDiagnosticServiceServer must be embedded to have
  49. // forward compatible implementations.
  50. //
  51. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  52. // pointer dereference when methods are called.
  53. type UnimplementedNetworkDiagnosticServiceServer struct{}
  54. func (UnimplementedNetworkDiagnosticServiceServer) NetworkLatencyProbe(context.Context, *NetworkLatencyProbeRequest) (*NetworkLatencyProbeReply, error) {
  55. return nil, status.Errorf(codes.Unimplemented, "method NetworkLatencyProbe not implemented")
  56. }
  57. func (UnimplementedNetworkDiagnosticServiceServer) mustEmbedUnimplementedNetworkDiagnosticServiceServer() {
  58. }
  59. func (UnimplementedNetworkDiagnosticServiceServer) testEmbeddedByValue() {}
  60. // UnsafeNetworkDiagnosticServiceServer may be embedded to opt out of forward compatibility for this service.
  61. // Use of this interface is not recommended, as added methods to NetworkDiagnosticServiceServer will
  62. // result in compilation errors.
  63. type UnsafeNetworkDiagnosticServiceServer interface {
  64. mustEmbedUnimplementedNetworkDiagnosticServiceServer()
  65. }
  66. func RegisterNetworkDiagnosticServiceServer(s grpc.ServiceRegistrar, srv NetworkDiagnosticServiceServer) {
  67. // If the following call pancis, it indicates UnimplementedNetworkDiagnosticServiceServer was
  68. // embedded by pointer and is nil. This will cause panics if an
  69. // unimplemented method is ever invoked, so we test this at initialization
  70. // time to prevent it from happening at runtime later due to I/O.
  71. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  72. t.testEmbeddedByValue()
  73. }
  74. s.RegisterService(&NetworkDiagnosticService_ServiceDesc, srv)
  75. }
  76. func _NetworkDiagnosticService_NetworkLatencyProbe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  77. in := new(NetworkLatencyProbeRequest)
  78. if err := dec(in); err != nil {
  79. return nil, err
  80. }
  81. if interceptor == nil {
  82. return srv.(NetworkDiagnosticServiceServer).NetworkLatencyProbe(ctx, in)
  83. }
  84. info := &grpc.UnaryServerInfo{
  85. Server: srv,
  86. FullMethod: NetworkDiagnosticService_NetworkLatencyProbe_FullMethodName,
  87. }
  88. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  89. return srv.(NetworkDiagnosticServiceServer).NetworkLatencyProbe(ctx, req.(*NetworkLatencyProbeRequest))
  90. }
  91. return interceptor(ctx, in, info, handler)
  92. }
  93. // NetworkDiagnosticService_ServiceDesc is the grpc.ServiceDesc for NetworkDiagnosticService service.
  94. // It's only intended for direct use with grpc.RegisterService,
  95. // and not to be introspected or modified (even as a copy)
  96. var NetworkDiagnosticService_ServiceDesc = grpc.ServiceDesc{
  97. ServiceName: "networkdiagnostic.NetworkDiagnosticService",
  98. HandlerType: (*NetworkDiagnosticServiceServer)(nil),
  99. Methods: []grpc.MethodDesc{
  100. {
  101. MethodName: "NetworkLatencyProbe",
  102. Handler: _NetworkDiagnosticService_NetworkLatencyProbe_Handler,
  103. },
  104. },
  105. Streams: []grpc.StreamDesc{},
  106. Metadata: "networkDiagnostic.proto",
  107. }