google.golang.org/grpc@v1.72.2/interop/grpc_testing/report_qps_scenario_service_grpc.pb.go (about) 1 // Copyright 2015 gRPC authors. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // An integration test service that covers all the method signature permutations 16 // of unary/streaming requests/responses. 17 18 // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 19 // versions: 20 // - protoc-gen-go-grpc v1.5.1 21 // - protoc v5.27.1 22 // source: grpc/testing/report_qps_scenario_service.proto 23 24 package grpc_testing 25 26 import ( 27 context "context" 28 grpc "google.golang.org/grpc" 29 codes "google.golang.org/grpc/codes" 30 status "google.golang.org/grpc/status" 31 ) 32 33 // This is a compile-time assertion to ensure that this generated file 34 // is compatible with the grpc package it is being compiled against. 35 // Requires gRPC-Go v1.64.0 or later. 36 const _ = grpc.SupportPackageIsVersion9 37 38 const ( 39 ReportQpsScenarioService_ReportScenario_FullMethodName = "/grpc.testing.ReportQpsScenarioService/ReportScenario" 40 ) 41 42 // ReportQpsScenarioServiceClient is the client API for ReportQpsScenarioService service. 43 // 44 // 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. 45 type ReportQpsScenarioServiceClient interface { 46 // Report results of a QPS test benchmark scenario. 47 ReportScenario(ctx context.Context, in *ScenarioResult, opts ...grpc.CallOption) (*Void, error) 48 } 49 50 type reportQpsScenarioServiceClient struct { 51 cc grpc.ClientConnInterface 52 } 53 54 func NewReportQpsScenarioServiceClient(cc grpc.ClientConnInterface) ReportQpsScenarioServiceClient { 55 return &reportQpsScenarioServiceClient{cc} 56 } 57 58 func (c *reportQpsScenarioServiceClient) ReportScenario(ctx context.Context, in *ScenarioResult, opts ...grpc.CallOption) (*Void, error) { 59 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 60 out := new(Void) 61 err := c.cc.Invoke(ctx, ReportQpsScenarioService_ReportScenario_FullMethodName, in, out, cOpts...) 62 if err != nil { 63 return nil, err 64 } 65 return out, nil 66 } 67 68 // ReportQpsScenarioServiceServer is the server API for ReportQpsScenarioService service. 69 // All implementations must embed UnimplementedReportQpsScenarioServiceServer 70 // for forward compatibility. 71 type ReportQpsScenarioServiceServer interface { 72 // Report results of a QPS test benchmark scenario. 73 ReportScenario(context.Context, *ScenarioResult) (*Void, error) 74 mustEmbedUnimplementedReportQpsScenarioServiceServer() 75 } 76 77 // UnimplementedReportQpsScenarioServiceServer must be embedded to have 78 // forward compatible implementations. 79 // 80 // NOTE: this should be embedded by value instead of pointer to avoid a nil 81 // pointer dereference when methods are called. 82 type UnimplementedReportQpsScenarioServiceServer struct{} 83 84 func (UnimplementedReportQpsScenarioServiceServer) ReportScenario(context.Context, *ScenarioResult) (*Void, error) { 85 return nil, status.Errorf(codes.Unimplemented, "method ReportScenario not implemented") 86 } 87 func (UnimplementedReportQpsScenarioServiceServer) mustEmbedUnimplementedReportQpsScenarioServiceServer() { 88 } 89 func (UnimplementedReportQpsScenarioServiceServer) testEmbeddedByValue() {} 90 91 // UnsafeReportQpsScenarioServiceServer may be embedded to opt out of forward compatibility for this service. 92 // Use of this interface is not recommended, as added methods to ReportQpsScenarioServiceServer will 93 // result in compilation errors. 94 type UnsafeReportQpsScenarioServiceServer interface { 95 mustEmbedUnimplementedReportQpsScenarioServiceServer() 96 } 97 98 func RegisterReportQpsScenarioServiceServer(s grpc.ServiceRegistrar, srv ReportQpsScenarioServiceServer) { 99 // If the following call panics, it indicates UnimplementedReportQpsScenarioServiceServer was 100 // embedded by pointer and is nil. This will cause panics if an 101 // unimplemented method is ever invoked, so we test this at initialization 102 // time to prevent it from happening at runtime later due to I/O. 103 if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 104 t.testEmbeddedByValue() 105 } 106 s.RegisterService(&ReportQpsScenarioService_ServiceDesc, srv) 107 } 108 109 func _ReportQpsScenarioService_ReportScenario_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 110 in := new(ScenarioResult) 111 if err := dec(in); err != nil { 112 return nil, err 113 } 114 if interceptor == nil { 115 return srv.(ReportQpsScenarioServiceServer).ReportScenario(ctx, in) 116 } 117 info := &grpc.UnaryServerInfo{ 118 Server: srv, 119 FullMethod: ReportQpsScenarioService_ReportScenario_FullMethodName, 120 } 121 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 122 return srv.(ReportQpsScenarioServiceServer).ReportScenario(ctx, req.(*ScenarioResult)) 123 } 124 return interceptor(ctx, in, info, handler) 125 } 126 127 // ReportQpsScenarioService_ServiceDesc is the grpc.ServiceDesc for ReportQpsScenarioService service. 128 // It's only intended for direct use with grpc.RegisterService, 129 // and not to be introspected or modified (even as a copy) 130 var ReportQpsScenarioService_ServiceDesc = grpc.ServiceDesc{ 131 ServiceName: "grpc.testing.ReportQpsScenarioService", 132 HandlerType: (*ReportQpsScenarioServiceServer)(nil), 133 Methods: []grpc.MethodDesc{ 134 { 135 MethodName: "ReportScenario", 136 Handler: _ReportQpsScenarioService_ReportScenario_Handler, 137 }, 138 }, 139 Streams: []grpc.StreamDesc{}, 140 Metadata: "grpc/testing/report_qps_scenario_service.proto", 141 }