google.golang.org/grpc@v1.72.2/internal/proto/grpc_lookup_v1/rls_grpc.pb.go (about) 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.5.1 18 // - protoc v5.27.1 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 75 // forward compatible implementations. 76 // 77 // NOTE: this should be embedded by value instead of pointer to avoid a nil 78 // pointer dereference when methods are called. 79 type UnimplementedRouteLookupServiceServer struct{} 80 81 func (UnimplementedRouteLookupServiceServer) RouteLookup(context.Context, *RouteLookupRequest) (*RouteLookupResponse, error) { 82 return nil, status.Errorf(codes.Unimplemented, "method RouteLookup not implemented") 83 } 84 func (UnimplementedRouteLookupServiceServer) mustEmbedUnimplementedRouteLookupServiceServer() {} 85 func (UnimplementedRouteLookupServiceServer) testEmbeddedByValue() {} 86 87 // UnsafeRouteLookupServiceServer may be embedded to opt out of forward compatibility for this service. 88 // Use of this interface is not recommended, as added methods to RouteLookupServiceServer will 89 // result in compilation errors. 90 type UnsafeRouteLookupServiceServer interface { 91 mustEmbedUnimplementedRouteLookupServiceServer() 92 } 93 94 func RegisterRouteLookupServiceServer(s grpc.ServiceRegistrar, srv RouteLookupServiceServer) { 95 // If the following call panics, it indicates UnimplementedRouteLookupServiceServer was 96 // embedded by pointer and is nil. This will cause panics if an 97 // unimplemented method is ever invoked, so we test this at initialization 98 // time to prevent it from happening at runtime later due to I/O. 99 if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 100 t.testEmbeddedByValue() 101 } 102 s.RegisterService(&RouteLookupService_ServiceDesc, srv) 103 } 104 105 func _RouteLookupService_RouteLookup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 106 in := new(RouteLookupRequest) 107 if err := dec(in); err != nil { 108 return nil, err 109 } 110 if interceptor == nil { 111 return srv.(RouteLookupServiceServer).RouteLookup(ctx, in) 112 } 113 info := &grpc.UnaryServerInfo{ 114 Server: srv, 115 FullMethod: RouteLookupService_RouteLookup_FullMethodName, 116 } 117 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 118 return srv.(RouteLookupServiceServer).RouteLookup(ctx, req.(*RouteLookupRequest)) 119 } 120 return interceptor(ctx, in, info, handler) 121 } 122 123 // RouteLookupService_ServiceDesc is the grpc.ServiceDesc for RouteLookupService service. 124 // It's only intended for direct use with grpc.RegisterService, 125 // and not to be introspected or modified (even as a copy) 126 var RouteLookupService_ServiceDesc = grpc.ServiceDesc{ 127 ServiceName: "grpc.lookup.v1.RouteLookupService", 128 HandlerType: (*RouteLookupServiceServer)(nil), 129 Methods: []grpc.MethodDesc{ 130 { 131 MethodName: "RouteLookup", 132 Handler: _RouteLookupService_RouteLookup_Handler, 133 }, 134 }, 135 Streams: []grpc.StreamDesc{}, 136 Metadata: "grpc/lookup/v1/rls.proto", 137 }