...

Source file src/google.golang.org/grpc/internal/proto/grpc_lookup_v1/rls_grpc.pb.go

Documentation: google.golang.org/grpc/internal/proto/grpc_lookup_v1

     1  // Copyright 2020 The 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  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
    16  // versions:
    17  // - protoc-gen-go-grpc v1.3.0
    18  // - protoc             v4.25.2
    19  // source: grpc/lookup/v1/rls.proto
    20  
    21  package grpc_lookup_v1
    22  
    23  import (
    24  	context "context"
    25  	grpc "google.golang.org/grpc"
    26  	codes "google.golang.org/grpc/codes"
    27  	status "google.golang.org/grpc/status"
    28  )
    29  
    30  // This is a compile-time assertion to ensure that this generated file
    31  // is compatible with the grpc package it is being compiled against.
    32  // Requires gRPC-Go v1.64.0 or later.
    33  const _ = grpc.SupportPackageIsVersion9
    34  
    35  const (
    36  	RouteLookupService_RouteLookup_FullMethodName = "/grpc.lookup.v1.RouteLookupService/RouteLookup"
    37  )
    38  
    39  // RouteLookupServiceClient is the client API for RouteLookupService service.
    40  //
    41  // 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.
    42  type RouteLookupServiceClient interface {
    43  	// Lookup returns a target for a single key.
    44  	RouteLookup(ctx context.Context, in *RouteLookupRequest, opts ...grpc.CallOption) (*RouteLookupResponse, error)
    45  }
    46  
    47  type routeLookupServiceClient struct {
    48  	cc grpc.ClientConnInterface
    49  }
    50  
    51  func NewRouteLookupServiceClient(cc grpc.ClientConnInterface) RouteLookupServiceClient {
    52  	return &routeLookupServiceClient{cc}
    53  }
    54  
    55  func (c *routeLookupServiceClient) RouteLookup(ctx context.Context, in *RouteLookupRequest, opts ...grpc.CallOption) (*RouteLookupResponse, error) {
    56  	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
    57  	out := new(RouteLookupResponse)
    58  	err := c.cc.Invoke(ctx, RouteLookupService_RouteLookup_FullMethodName, in, out, cOpts...)
    59  	if err != nil {
    60  		return nil, err
    61  	}
    62  	return out, nil
    63  }
    64  
    65  // RouteLookupServiceServer is the server API for RouteLookupService service.
    66  // All implementations must embed UnimplementedRouteLookupServiceServer
    67  // for forward compatibility
    68  type RouteLookupServiceServer interface {
    69  	// Lookup returns a target for a single key.
    70  	RouteLookup(context.Context, *RouteLookupRequest) (*RouteLookupResponse, error)
    71  	mustEmbedUnimplementedRouteLookupServiceServer()
    72  }
    73  
    74  // UnimplementedRouteLookupServiceServer must be embedded to have forward compatible implementations.
    75  type UnimplementedRouteLookupServiceServer struct {
    76  }
    77  
    78  func (UnimplementedRouteLookupServiceServer) RouteLookup(context.Context, *RouteLookupRequest) (*RouteLookupResponse, error) {
    79  	return nil, status.Errorf(codes.Unimplemented, "method RouteLookup not implemented")
    80  }
    81  func (UnimplementedRouteLookupServiceServer) mustEmbedUnimplementedRouteLookupServiceServer() {}
    82  
    83  // UnsafeRouteLookupServiceServer may be embedded to opt out of forward compatibility for this service.
    84  // Use of this interface is not recommended, as added methods to RouteLookupServiceServer will
    85  // result in compilation errors.
    86  type UnsafeRouteLookupServiceServer interface {
    87  	mustEmbedUnimplementedRouteLookupServiceServer()
    88  }
    89  
    90  func RegisterRouteLookupServiceServer(s grpc.ServiceRegistrar, srv RouteLookupServiceServer) {
    91  	s.RegisterService(&RouteLookupService_ServiceDesc, srv)
    92  }
    93  
    94  func _RouteLookupService_RouteLookup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
    95  	in := new(RouteLookupRequest)
    96  	if err := dec(in); err != nil {
    97  		return nil, err
    98  	}
    99  	if interceptor == nil {
   100  		return srv.(RouteLookupServiceServer).RouteLookup(ctx, in)
   101  	}
   102  	info := &grpc.UnaryServerInfo{
   103  		Server:     srv,
   104  		FullMethod: RouteLookupService_RouteLookup_FullMethodName,
   105  	}
   106  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   107  		return srv.(RouteLookupServiceServer).RouteLookup(ctx, req.(*RouteLookupRequest))
   108  	}
   109  	return interceptor(ctx, in, info, handler)
   110  }
   111  
   112  // RouteLookupService_ServiceDesc is the grpc.ServiceDesc for RouteLookupService service.
   113  // It's only intended for direct use with grpc.RegisterService,
   114  // and not to be introspected or modified (even as a copy)
   115  var RouteLookupService_ServiceDesc = grpc.ServiceDesc{
   116  	ServiceName: "grpc.lookup.v1.RouteLookupService",
   117  	HandlerType: (*RouteLookupServiceServer)(nil),
   118  	Methods: []grpc.MethodDesc{
   119  		{
   120  			MethodName: "RouteLookup",
   121  			Handler:    _RouteLookupService_RouteLookup_Handler,
   122  		},
   123  	},
   124  	Streams:  []grpc.StreamDesc{},
   125  	Metadata: "grpc/lookup/v1/rls.proto",
   126  }
   127  

View as plain text