module/apmgrpc/internal/testservice/testservice_grpc.pb.go (97 lines of code) (raw):

// Licensed to Elasticsearch B.V. under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright // ownership. Elasticsearch B.V. licenses this file to you under // the Apache License, Version 2.0 (the "License"); you may // not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 // - protoc v4.24.2 // source: testservice.proto package testservice import ( context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 const ( Accumulator_Accumulate_FullMethodName = "/go.elastic.co.apm.module.apmgrpc.testservice.Accumulator/Accumulate" ) // AccumulatorClient is the client API for Accumulator service. // // 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. type AccumulatorClient interface { Accumulate(ctx context.Context, opts ...grpc.CallOption) (Accumulator_AccumulateClient, error) } type accumulatorClient struct { cc grpc.ClientConnInterface } func NewAccumulatorClient(cc grpc.ClientConnInterface) AccumulatorClient { return &accumulatorClient{cc} } func (c *accumulatorClient) Accumulate(ctx context.Context, opts ...grpc.CallOption) (Accumulator_AccumulateClient, error) { stream, err := c.cc.NewStream(ctx, &Accumulator_ServiceDesc.Streams[0], Accumulator_Accumulate_FullMethodName, opts...) if err != nil { return nil, err } x := &accumulatorAccumulateClient{stream} return x, nil } type Accumulator_AccumulateClient interface { Send(*AccumulateRequest) error Recv() (*AccumulateReply, error) grpc.ClientStream } type accumulatorAccumulateClient struct { grpc.ClientStream } func (x *accumulatorAccumulateClient) Send(m *AccumulateRequest) error { return x.ClientStream.SendMsg(m) } func (x *accumulatorAccumulateClient) Recv() (*AccumulateReply, error) { m := new(AccumulateReply) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } // AccumulatorServer is the server API for Accumulator service. // All implementations must embed UnimplementedAccumulatorServer // for forward compatibility type AccumulatorServer interface { Accumulate(Accumulator_AccumulateServer) error mustEmbedUnimplementedAccumulatorServer() } // UnimplementedAccumulatorServer must be embedded to have forward compatible implementations. type UnimplementedAccumulatorServer struct { } func (UnimplementedAccumulatorServer) Accumulate(Accumulator_AccumulateServer) error { return status.Errorf(codes.Unimplemented, "method Accumulate not implemented") } func (UnimplementedAccumulatorServer) mustEmbedUnimplementedAccumulatorServer() {} // UnsafeAccumulatorServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to AccumulatorServer will // result in compilation errors. type UnsafeAccumulatorServer interface { mustEmbedUnimplementedAccumulatorServer() } func RegisterAccumulatorServer(s grpc.ServiceRegistrar, srv AccumulatorServer) { s.RegisterService(&Accumulator_ServiceDesc, srv) } func _Accumulator_Accumulate_Handler(srv interface{}, stream grpc.ServerStream) error { return srv.(AccumulatorServer).Accumulate(&accumulatorAccumulateServer{stream}) } type Accumulator_AccumulateServer interface { Send(*AccumulateReply) error Recv() (*AccumulateRequest, error) grpc.ServerStream } type accumulatorAccumulateServer struct { grpc.ServerStream } func (x *accumulatorAccumulateServer) Send(m *AccumulateReply) error { return x.ServerStream.SendMsg(m) } func (x *accumulatorAccumulateServer) Recv() (*AccumulateRequest, error) { m := new(AccumulateRequest) if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err } return m, nil } // Accumulator_ServiceDesc is the grpc.ServiceDesc for Accumulator service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Accumulator_ServiceDesc = grpc.ServiceDesc{ ServiceName: "go.elastic.co.apm.module.apmgrpc.testservice.Accumulator", HandlerType: (*AccumulatorServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Accumulate", Handler: _Accumulator_Accumulate_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "testservice.proto", }