mirror of https://github.com/grpc/grpc-go.git
130 lines
3.9 KiB
Go
130 lines
3.9 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
|
|
package grpc_lb_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
|
|
|
|
// LoadBalancerClient is the client API for LoadBalancer service.
|
|
//
|
|
// 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.
|
|
type LoadBalancerClient interface {
|
|
// Bidirectional rpc to get a list of servers.
|
|
BalanceLoad(ctx context.Context, opts ...grpc.CallOption) (LoadBalancer_BalanceLoadClient, error)
|
|
}
|
|
|
|
type loadBalancerClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewLoadBalancerClient(cc grpc.ClientConnInterface) LoadBalancerClient {
|
|
return &loadBalancerClient{cc}
|
|
}
|
|
|
|
func (c *loadBalancerClient) BalanceLoad(ctx context.Context, opts ...grpc.CallOption) (LoadBalancer_BalanceLoadClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &_LoadBalancer_serviceDesc.Streams[0], "/grpc.lb.v1.LoadBalancer/BalanceLoad", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &loadBalancerBalanceLoadClient{stream}
|
|
return x, nil
|
|
}
|
|
|
|
type LoadBalancer_BalanceLoadClient interface {
|
|
Send(*LoadBalanceRequest) error
|
|
Recv() (*LoadBalanceResponse, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type loadBalancerBalanceLoadClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *loadBalancerBalanceLoadClient) Send(m *LoadBalanceRequest) error {
|
|
return x.ClientStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *loadBalancerBalanceLoadClient) Recv() (*LoadBalanceResponse, error) {
|
|
m := new(LoadBalanceResponse)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
// LoadBalancerServer is the server API for LoadBalancer service.
|
|
// All implementations should embed UnimplementedLoadBalancerServer
|
|
// for forward compatibility
|
|
type LoadBalancerServer interface {
|
|
// Bidirectional rpc to get a list of servers.
|
|
BalanceLoad(LoadBalancer_BalanceLoadServer) error
|
|
}
|
|
|
|
// UnimplementedLoadBalancerServer should be embedded to have forward compatible implementations.
|
|
type UnimplementedLoadBalancerServer struct {
|
|
}
|
|
|
|
func (UnimplementedLoadBalancerServer) BalanceLoad(LoadBalancer_BalanceLoadServer) error {
|
|
return status.Errorf(codes.Unimplemented, "method BalanceLoad not implemented")
|
|
}
|
|
|
|
// UnsafeLoadBalancerServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to LoadBalancerServer will
|
|
// result in compilation errors.
|
|
type UnsafeLoadBalancerServer interface {
|
|
mustEmbedUnimplementedLoadBalancerServer()
|
|
}
|
|
|
|
func RegisterLoadBalancerServer(s grpc.ServiceRegistrar, srv LoadBalancerServer) {
|
|
s.RegisterService(&_LoadBalancer_serviceDesc, srv)
|
|
}
|
|
|
|
func _LoadBalancer_BalanceLoad_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(LoadBalancerServer).BalanceLoad(&loadBalancerBalanceLoadServer{stream})
|
|
}
|
|
|
|
type LoadBalancer_BalanceLoadServer interface {
|
|
Send(*LoadBalanceResponse) error
|
|
Recv() (*LoadBalanceRequest, error)
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type loadBalancerBalanceLoadServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *loadBalancerBalanceLoadServer) Send(m *LoadBalanceResponse) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
func (x *loadBalancerBalanceLoadServer) Recv() (*LoadBalanceRequest, error) {
|
|
m := new(LoadBalanceRequest)
|
|
if err := x.ServerStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
var _LoadBalancer_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "grpc.lb.v1.LoadBalancer",
|
|
HandlerType: (*LoadBalancerServer)(nil),
|
|
Methods: []grpc.MethodDesc{},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "BalanceLoad",
|
|
Handler: _LoadBalancer_BalanceLoad_Handler,
|
|
ServerStreams: true,
|
|
ClientStreams: true,
|
|
},
|
|
},
|
|
Metadata: "grpc/lb/v1/load_balancer.proto",
|
|
}
|