istio.io/istio@v0.0.0-20240520182934-d79c90f27776/pkg/test/echo/proto/echo_grpc.pb.go (about)

     1  // Copyright Istio 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  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
    16  // versions:
    17  // - protoc-gen-go-grpc v1.3.0
    18  // - protoc             (unknown)
    19  // source: test/echo/proto/echo.proto
    20  
    21  // Generate with protoc --go_out=. echo.proto -I /work/common-protos/ -I.
    22  
    23  package proto
    24  
    25  import (
    26  	context "context"
    27  	grpc "google.golang.org/grpc"
    28  	codes "google.golang.org/grpc/codes"
    29  	status "google.golang.org/grpc/status"
    30  )
    31  
    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
    36  
    37  const (
    38  	EchoTestService_Echo_FullMethodName        = "/proto.EchoTestService/Echo"
    39  	EchoTestService_ForwardEcho_FullMethodName = "/proto.EchoTestService/ForwardEcho"
    40  )
    41  
    42  // EchoTestServiceClient is the client API for EchoTestService 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 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)
    48  }
    49  
    50  type echoTestServiceClient struct {
    51  	cc grpc.ClientConnInterface
    52  }
    53  
    54  func NewEchoTestServiceClient(cc grpc.ClientConnInterface) EchoTestServiceClient {
    55  	return &echoTestServiceClient{cc}
    56  }
    57  
    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...)
    61  	if err != nil {
    62  		return nil, err
    63  	}
    64  	return out, nil
    65  }
    66  
    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...)
    70  	if err != nil {
    71  		return nil, err
    72  	}
    73  	return out, nil
    74  }
    75  
    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()
    83  }
    84  
    85  // UnimplementedEchoTestServiceServer must be embedded to have forward compatible implementations.
    86  type UnimplementedEchoTestServiceServer struct {
    87  }
    88  
    89  func (UnimplementedEchoTestServiceServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error) {
    90  	return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented")
    91  }
    92  func (UnimplementedEchoTestServiceServer) ForwardEcho(context.Context, *ForwardEchoRequest) (*ForwardEchoResponse, error) {
    93  	return nil, status.Errorf(codes.Unimplemented, "method ForwardEcho not implemented")
    94  }
    95  func (UnimplementedEchoTestServiceServer) mustEmbedUnimplementedEchoTestServiceServer() {}
    96  
    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()
   102  }
   103  
   104  func RegisterEchoTestServiceServer(s grpc.ServiceRegistrar, srv EchoTestServiceServer) {
   105  	s.RegisterService(&EchoTestService_ServiceDesc, srv)
   106  }
   107  
   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 {
   111  		return nil, err
   112  	}
   113  	if interceptor == nil {
   114  		return srv.(EchoTestServiceServer).Echo(ctx, in)
   115  	}
   116  	info := &grpc.UnaryServerInfo{
   117  		Server:     srv,
   118  		FullMethod: EchoTestService_Echo_FullMethodName,
   119  	}
   120  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   121  		return srv.(EchoTestServiceServer).Echo(ctx, req.(*EchoRequest))
   122  	}
   123  	return interceptor(ctx, in, info, handler)
   124  }
   125  
   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 {
   129  		return nil, err
   130  	}
   131  	if interceptor == nil {
   132  		return srv.(EchoTestServiceServer).ForwardEcho(ctx, in)
   133  	}
   134  	info := &grpc.UnaryServerInfo{
   135  		Server:     srv,
   136  		FullMethod: EchoTestService_ForwardEcho_FullMethodName,
   137  	}
   138  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   139  		return srv.(EchoTestServiceServer).ForwardEcho(ctx, req.(*ForwardEchoRequest))
   140  	}
   141  	return interceptor(ctx, in, info, handler)
   142  }
   143  
   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{
   151  		{
   152  			MethodName: "Echo",
   153  			Handler:    _EchoTestService_Echo_Handler,
   154  		},
   155  		{
   156  			MethodName: "ForwardEcho",
   157  			Handler:    _EchoTestService_ForwardEcho_Handler,
   158  		},
   159  	},
   160  	Streams:  []grpc.StreamDesc{},
   161  	Metadata: "test/echo/proto/echo.proto",
   162  }