| // Code generated by protoc-gen-go-grpc. DO NOT EDIT. |
| |
| package grpc_lookup_v1 |
| |
| import ( |
| context "context" |
| grpc "google.golang.org/grpc" |
| codes "google.golang.org/grpc/codes" |
| status "google.golang.org/grpc/status" |
| ) |
| |
| // This is a compile-time assertion to ensure that this generated file |
| // is compatible with the grpc package it is being compiled against. |
| const _ = grpc.SupportPackageIsVersion7 |
| |
| // RouteLookupServiceService is the service API for RouteLookupService service. |
| // Fields should be assigned to their respective handler implementations only before |
| // RegisterRouteLookupServiceService is called. Any unassigned fields will result in the |
| // handler for that method returning an Unimplemented error. |
| type RouteLookupServiceService struct { |
| // Lookup returns a target for a single key. |
| RouteLookup func(context.Context, *RouteLookupRequest) (*RouteLookupResponse, error) |
| } |
| |
| func (s *RouteLookupServiceService) routeLookup(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| in := new(RouteLookupRequest) |
| if err := dec(in); err != nil { |
| return nil, err |
| } |
| if interceptor == nil { |
| return s.RouteLookup(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: s, |
| FullMethod: "/grpc.lookup.v1.RouteLookupService/RouteLookup", |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return s.RouteLookup(ctx, req.(*RouteLookupRequest)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| // RegisterRouteLookupServiceService registers a service implementation with a gRPC server. |
| func RegisterRouteLookupServiceService(s grpc.ServiceRegistrar, srv *RouteLookupServiceService) { |
| srvCopy := *srv |
| if srvCopy.RouteLookup == nil { |
| srvCopy.RouteLookup = func(context.Context, *RouteLookupRequest) (*RouteLookupResponse, error) { |
| return nil, status.Errorf(codes.Unimplemented, "method RouteLookup not implemented") |
| } |
| } |
| sd := grpc.ServiceDesc{ |
| ServiceName: "grpc.lookup.v1.RouteLookupService", |
| Methods: []grpc.MethodDesc{ |
| { |
| MethodName: "RouteLookup", |
| Handler: srvCopy.routeLookup, |
| }, |
| }, |
| Streams: []grpc.StreamDesc{}, |
| Metadata: "grpc/lookup/v1/rls.proto", |
| } |
| |
| s.RegisterService(&sd, nil) |
| } |
| |
| // NewRouteLookupServiceService creates a new RouteLookupServiceService containing the |
| // implemented methods of the RouteLookupService service in s. Any unimplemented |
| // methods will result in the gRPC server returning an UNIMPLEMENTED status to the client. |
| // This includes situations where the method handler is misspelled or has the wrong |
| // signature. For this reason, this function should be used with great care and |
| // is not recommended to be used by most users. |
| func NewRouteLookupServiceService(s interface{}) *RouteLookupServiceService { |
| ns := &RouteLookupServiceService{} |
| if h, ok := s.(interface { |
| RouteLookup(context.Context, *RouteLookupRequest) (*RouteLookupResponse, error) |
| }); ok { |
| ns.RouteLookup = h.RouteLookup |
| } |
| return ns |
| } |
| |
| // UnstableRouteLookupServiceService is the service API for RouteLookupService service. |
| // New methods may be added to this interface if they are added to the service |
| // definition, which is not a backward-compatible change. For this reason, |
| // use of this type is not recommended. |
| type UnstableRouteLookupServiceService interface { |
| // Lookup returns a target for a single key. |
| RouteLookup(context.Context, *RouteLookupRequest) (*RouteLookupResponse, error) |
| } |