| // Code generated by protoc-gen-go-grpc. DO NOT EDIT. |
| |
| package grpc_lb_v1 |
| |
| import ( |
| 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 |
| |
| // LoadBalancerService is the service API for LoadBalancer service. |
| // Fields should be assigned to their respective handler implementations only before |
| // RegisterLoadBalancerService is called. Any unassigned fields will result in the |
| // handler for that method returning an Unimplemented error. |
| type LoadBalancerService struct { |
| // Bidirectional rpc to get a list of servers. |
| BalanceLoad func(LoadBalancer_BalanceLoadServer) error |
| } |
| |
| func (s *LoadBalancerService) balanceLoad(_ interface{}, stream grpc.ServerStream) error { |
| return s.BalanceLoad(&loadBalancerBalanceLoadServer{stream}) |
| } |
| |
| // RegisterLoadBalancerService registers a service implementation with a gRPC server. |
| func RegisterLoadBalancerService(s grpc.ServiceRegistrar, srv *LoadBalancerService) { |
| srvCopy := *srv |
| if srvCopy.BalanceLoad == nil { |
| srvCopy.BalanceLoad = func(LoadBalancer_BalanceLoadServer) error { |
| return status.Errorf(codes.Unimplemented, "method BalanceLoad not implemented") |
| } |
| } |
| sd := grpc.ServiceDesc{ |
| ServiceName: "grpc.lb.v1.LoadBalancer", |
| Methods: []grpc.MethodDesc{}, |
| Streams: []grpc.StreamDesc{ |
| { |
| StreamName: "BalanceLoad", |
| Handler: srvCopy.balanceLoad, |
| ServerStreams: true, |
| ClientStreams: true, |
| }, |
| }, |
| Metadata: "grpc/lb/v1/load_balancer.proto", |
| } |
| |
| s.RegisterService(&sd, nil) |
| } |
| |
| // NewLoadBalancerService creates a new LoadBalancerService containing the |
| // implemented methods of the LoadBalancer 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 NewLoadBalancerService(s interface{}) *LoadBalancerService { |
| ns := &LoadBalancerService{} |
| if h, ok := s.(interface { |
| BalanceLoad(LoadBalancer_BalanceLoadServer) error |
| }); ok { |
| ns.BalanceLoad = h.BalanceLoad |
| } |
| return ns |
| } |
| |
| // UnstableLoadBalancerService is the service API for LoadBalancer 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 UnstableLoadBalancerService interface { |
| // Bidirectional rpc to get a list of servers. |
| BalanceLoad(LoadBalancer_BalanceLoadServer) error |
| } |