1
// Copyright Istio Authors
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
7
// http://www.apache.org/licenses/LICENSE-2.0
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.
15
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
17
// - protoc-gen-go-grpc v1.3.0
19
// source: test/echo/proto/echo.proto
21
// Generate with protoc --go_out=. echo.proto -I /work/common-protos/ -I.
27
grpc "google.golang.org/grpc"
28
codes "google.golang.org/grpc/codes"
29
status "google.golang.org/grpc/status"
32
// This is a compile-time assertion to ensure that this generated file
33
// is compatible with the grpc package it is being compiled against.
34
// Requires gRPC-Go v1.32.0 or later.
35
const _ = grpc.SupportPackageIsVersion7
38
EchoTestService_Echo_FullMethodName = "/proto.EchoTestService/Echo"
39
EchoTestService_ForwardEcho_FullMethodName = "/proto.EchoTestService/ForwardEcho"
42
// EchoTestServiceClient is the client API for EchoTestService service.
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 EchoTestServiceClient interface {
46
Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
47
ForwardEcho(ctx context.Context, in *ForwardEchoRequest, opts ...grpc.CallOption) (*ForwardEchoResponse, error)
50
type echoTestServiceClient struct {
51
cc grpc.ClientConnInterface
54
func NewEchoTestServiceClient(cc grpc.ClientConnInterface) EchoTestServiceClient {
55
return &echoTestServiceClient{cc}
58
func (c *echoTestServiceClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) {
59
out := new(EchoResponse)
60
err := c.cc.Invoke(ctx, EchoTestService_Echo_FullMethodName, in, out, opts...)
67
func (c *echoTestServiceClient) ForwardEcho(ctx context.Context, in *ForwardEchoRequest, opts ...grpc.CallOption) (*ForwardEchoResponse, error) {
68
out := new(ForwardEchoResponse)
69
err := c.cc.Invoke(ctx, EchoTestService_ForwardEcho_FullMethodName, in, out, opts...)
76
// EchoTestServiceServer is the server API for EchoTestService service.
77
// All implementations must embed UnimplementedEchoTestServiceServer
78
// for forward compatibility
79
type EchoTestServiceServer interface {
80
Echo(context.Context, *EchoRequest) (*EchoResponse, error)
81
ForwardEcho(context.Context, *ForwardEchoRequest) (*ForwardEchoResponse, error)
82
mustEmbedUnimplementedEchoTestServiceServer()
85
// UnimplementedEchoTestServiceServer must be embedded to have forward compatible implementations.
86
type UnimplementedEchoTestServiceServer struct {
89
func (UnimplementedEchoTestServiceServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error) {
90
return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented")
92
func (UnimplementedEchoTestServiceServer) ForwardEcho(context.Context, *ForwardEchoRequest) (*ForwardEchoResponse, error) {
93
return nil, status.Errorf(codes.Unimplemented, "method ForwardEcho not implemented")
95
func (UnimplementedEchoTestServiceServer) mustEmbedUnimplementedEchoTestServiceServer() {}
97
// UnsafeEchoTestServiceServer may be embedded to opt out of forward compatibility for this service.
98
// Use of this interface is not recommended, as added methods to EchoTestServiceServer will
99
// result in compilation errors.
100
type UnsafeEchoTestServiceServer interface {
101
mustEmbedUnimplementedEchoTestServiceServer()
104
func RegisterEchoTestServiceServer(s grpc.ServiceRegistrar, srv EchoTestServiceServer) {
105
s.RegisterService(&EchoTestService_ServiceDesc, srv)
108
func _EchoTestService_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
109
in := new(EchoRequest)
110
if err := dec(in); err != nil {
113
if interceptor == nil {
114
return srv.(EchoTestServiceServer).Echo(ctx, in)
116
info := &grpc.UnaryServerInfo{
118
FullMethod: EchoTestService_Echo_FullMethodName,
120
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
121
return srv.(EchoTestServiceServer).Echo(ctx, req.(*EchoRequest))
123
return interceptor(ctx, in, info, handler)
126
func _EchoTestService_ForwardEcho_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
127
in := new(ForwardEchoRequest)
128
if err := dec(in); err != nil {
131
if interceptor == nil {
132
return srv.(EchoTestServiceServer).ForwardEcho(ctx, in)
134
info := &grpc.UnaryServerInfo{
136
FullMethod: EchoTestService_ForwardEcho_FullMethodName,
138
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
139
return srv.(EchoTestServiceServer).ForwardEcho(ctx, req.(*ForwardEchoRequest))
141
return interceptor(ctx, in, info, handler)
144
// EchoTestService_ServiceDesc is the grpc.ServiceDesc for EchoTestService service.
145
// It's only intended for direct use with grpc.RegisterService,
146
// and not to be introspected or modified (even as a copy)
147
var EchoTestService_ServiceDesc = grpc.ServiceDesc{
148
ServiceName: "proto.EchoTestService",
149
HandlerType: (*EchoTestServiceServer)(nil),
150
Methods: []grpc.MethodDesc{
153
Handler: _EchoTestService_Echo_Handler,
156
MethodName: "ForwardEcho",
157
Handler: _EchoTestService_ForwardEcho_Handler,
160
Streams: []grpc.StreamDesc{},
161
Metadata: "test/echo/proto/echo.proto",