...

Source file src/github.com/google/s2a-go/example/proto/echo_go_proto/echo_grpc.pb.go

Documentation: github.com/google/s2a-go/example/proto/echo_go_proto

     1  //
     2  //
     3  // Copyright 2022 Google LLC
     4  //
     5  // Licensed under the Apache License, Version 2.0 (the "License");
     6  // you may not use this file except in compliance with the License.
     7  // You may obtain a copy of the License at
     8  //
     9  //     https://www.apache.org/licenses/LICENSE-2.0
    10  //
    11  // Unless required by applicable law or agreed to in writing, software
    12  // distributed under the License is distributed on an "AS IS" BASIS,
    13  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  // See the License for the specific language governing permissions and
    15  // limitations under the License.
    16  //
    17  
    18  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
    19  // versions:
    20  // - protoc-gen-go-grpc v1.3.0
    21  // - protoc             v3.21.12
    22  // source: example/proto/echo.proto
    23  
    24  package echo_go_proto
    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.32.0 or later.
    36  const _ = grpc.SupportPackageIsVersion7
    37  
    38  const (
    39  	Echo_Echo_FullMethodName = "/s2av2.example.proto.Echo/Echo"
    40  )
    41  
    42  // EchoClient is the client API for Echo 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 EchoClient interface {
    46  	// The echo service replies back the same message in the request.
    47  	Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
    48  }
    49  
    50  type echoClient struct {
    51  	cc grpc.ClientConnInterface
    52  }
    53  
    54  func NewEchoClient(cc grpc.ClientConnInterface) EchoClient {
    55  	return &echoClient{cc}
    56  }
    57  
    58  func (c *echoClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) {
    59  	out := new(EchoResponse)
    60  	err := c.cc.Invoke(ctx, Echo_Echo_FullMethodName, in, out, opts...)
    61  	if err != nil {
    62  		return nil, err
    63  	}
    64  	return out, nil
    65  }
    66  
    67  // EchoServer is the server API for Echo service.
    68  // All implementations must embed UnimplementedEchoServer
    69  // for forward compatibility
    70  type EchoServer interface {
    71  	// The echo service replies back the same message in the request.
    72  	Echo(context.Context, *EchoRequest) (*EchoResponse, error)
    73  	mustEmbedUnimplementedEchoServer()
    74  }
    75  
    76  // UnimplementedEchoServer must be embedded to have forward compatible implementations.
    77  type UnimplementedEchoServer struct {
    78  }
    79  
    80  func (UnimplementedEchoServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error) {
    81  	return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented")
    82  }
    83  func (UnimplementedEchoServer) mustEmbedUnimplementedEchoServer() {}
    84  
    85  // UnsafeEchoServer may be embedded to opt out of forward compatibility for this service.
    86  // Use of this interface is not recommended, as added methods to EchoServer will
    87  // result in compilation errors.
    88  type UnsafeEchoServer interface {
    89  	mustEmbedUnimplementedEchoServer()
    90  }
    91  
    92  func RegisterEchoServer(s grpc.ServiceRegistrar, srv EchoServer) {
    93  	s.RegisterService(&Echo_ServiceDesc, srv)
    94  }
    95  
    96  func _Echo_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    97  	in := new(EchoRequest)
    98  	if err := dec(in); err != nil {
    99  		return nil, err
   100  	}
   101  	if interceptor == nil {
   102  		return srv.(EchoServer).Echo(ctx, in)
   103  	}
   104  	info := &grpc.UnaryServerInfo{
   105  		Server:     srv,
   106  		FullMethod: Echo_Echo_FullMethodName,
   107  	}
   108  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   109  		return srv.(EchoServer).Echo(ctx, req.(*EchoRequest))
   110  	}
   111  	return interceptor(ctx, in, info, handler)
   112  }
   113  
   114  // Echo_ServiceDesc is the grpc.ServiceDesc for Echo service.
   115  // It's only intended for direct use with grpc.RegisterService,
   116  // and not to be introspected or modified (even as a copy)
   117  var Echo_ServiceDesc = grpc.ServiceDesc{
   118  	ServiceName: "s2av2.example.proto.Echo",
   119  	HandlerType: (*EchoServer)(nil),
   120  	Methods: []grpc.MethodDesc{
   121  		{
   122  			MethodName: "Echo",
   123  			Handler:    _Echo_Echo_Handler,
   124  		},
   125  	},
   126  	Streams:  []grpc.StreamDesc{},
   127  	Metadata: "example/proto/echo.proto",
   128  }
   129  

View as plain text