...

Source file src/google.golang.org/grpc/interop/grpc_testing/report_qps_scenario_service_grpc.pb.go

Documentation: google.golang.org/grpc/interop/grpc_testing

     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.3.0
    21  // - protoc             v4.25.2
    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 forward compatible implementations.
    78  type UnimplementedReportQpsScenarioServiceServer struct {
    79  }
    80  
    81  func (UnimplementedReportQpsScenarioServiceServer) ReportScenario(context.Context, *ScenarioResult) (*Void, error) {
    82  	return nil, status.Errorf(codes.Unimplemented, "method ReportScenario not implemented")
    83  }
    84  func (UnimplementedReportQpsScenarioServiceServer) mustEmbedUnimplementedReportQpsScenarioServiceServer() {
    85  }
    86  
    87  // UnsafeReportQpsScenarioServiceServer may be embedded to opt out of forward compatibility for this service.
    88  // Use of this interface is not recommended, as added methods to ReportQpsScenarioServiceServer will
    89  // result in compilation errors.
    90  type UnsafeReportQpsScenarioServiceServer interface {
    91  	mustEmbedUnimplementedReportQpsScenarioServiceServer()
    92  }
    93  
    94  func RegisterReportQpsScenarioServiceServer(s grpc.ServiceRegistrar, srv ReportQpsScenarioServiceServer) {
    95  	s.RegisterService(&ReportQpsScenarioService_ServiceDesc, srv)
    96  }
    97  
    98  func _ReportQpsScenarioService_ReportScenario_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    99  	in := new(ScenarioResult)
   100  	if err := dec(in); err != nil {
   101  		return nil, err
   102  	}
   103  	if interceptor == nil {
   104  		return srv.(ReportQpsScenarioServiceServer).ReportScenario(ctx, in)
   105  	}
   106  	info := &grpc.UnaryServerInfo{
   107  		Server:     srv,
   108  		FullMethod: ReportQpsScenarioService_ReportScenario_FullMethodName,
   109  	}
   110  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   111  		return srv.(ReportQpsScenarioServiceServer).ReportScenario(ctx, req.(*ScenarioResult))
   112  	}
   113  	return interceptor(ctx, in, info, handler)
   114  }
   115  
   116  // ReportQpsScenarioService_ServiceDesc is the grpc.ServiceDesc for ReportQpsScenarioService service.
   117  // It's only intended for direct use with grpc.RegisterService,
   118  // and not to be introspected or modified (even as a copy)
   119  var ReportQpsScenarioService_ServiceDesc = grpc.ServiceDesc{
   120  	ServiceName: "grpc.testing.ReportQpsScenarioService",
   121  	HandlerType: (*ReportQpsScenarioServiceServer)(nil),
   122  	Methods: []grpc.MethodDesc{
   123  		{
   124  			MethodName: "ReportScenario",
   125  			Handler:    _ReportQpsScenarioService_ReportScenario_Handler,
   126  		},
   127  	},
   128  	Streams:  []grpc.StreamDesc{},
   129  	Metadata: "grpc/testing/report_qps_scenario_service.proto",
   130  }
   131  

View as plain text