Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterLoadBalancerServer(s grpc.ServiceRegistrar, srv LoadBalancerServer)
- type AddTargetRequest
- func (*AddTargetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AddTargetRequest) GetLbName() string
- func (x *AddTargetRequest) GetSrcPort() int32
- func (x *AddTargetRequest) GetTarget() *Target
- func (*AddTargetRequest) ProtoMessage()
- func (x *AddTargetRequest) ProtoReflect() protoreflect.Message
- func (x *AddTargetRequest) Reset()
- func (x *AddTargetRequest) String() string
- type CreateLoadBalancer
- func (*CreateLoadBalancer) Descriptor() ([]byte, []int)deprecated
- func (x *CreateLoadBalancer) GetIpAddr() string
- func (x *CreateLoadBalancer) GetName() string
- func (*CreateLoadBalancer) ProtoMessage()
- func (x *CreateLoadBalancer) ProtoReflect() protoreflect.Message
- func (x *CreateLoadBalancer) Reset()
- func (x *CreateLoadBalancer) String() string
- type DelTargetRequest
- func (*DelTargetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DelTargetRequest) GetLbName() string
- func (x *DelTargetRequest) GetSrcPort() int32
- func (x *DelTargetRequest) GetTarget() *Target
- func (*DelTargetRequest) ProtoMessage()
- func (x *DelTargetRequest) ProtoReflect() protoreflect.Message
- func (x *DelTargetRequest) Reset()
- func (x *DelTargetRequest) String() string
- type Error
- type Intf
- type LoadBalancerClient
- type LoadBalancerInformation
- func (*LoadBalancerInformation) Descriptor() ([]byte, []int)deprecated
- func (x *LoadBalancerInformation) GetIpAddr() string
- func (x *LoadBalancerInformation) GetName() string
- func (x *LoadBalancerInformation) GetTargets() map[int32]*TargetList
- func (*LoadBalancerInformation) ProtoMessage()
- func (x *LoadBalancerInformation) ProtoReflect() protoreflect.Message
- func (x *LoadBalancerInformation) Reset()
- func (x *LoadBalancerInformation) String() string
- type LoadBalancerName
- type LoadBalancerServer
- type LoadBalancer_GetLoadBalancersClient
- type LoadBalancer_GetLoadBalancersServer
- type Protocol
- type Target
- func (*Target) Descriptor() ([]byte, []int)deprecated
- func (x *Target) GetDstIP() string
- func (x *Target) GetDstPort() int32
- func (x *Target) GetProtocol() Protocol
- func (*Target) ProtoMessage()
- func (x *Target) ProtoReflect() protoreflect.Message
- func (x *Target) Reset()
- func (x *Target) String() string
- type TargetList
- type UnimplementedLoadBalancerServer
- func (UnimplementedLoadBalancerServer) AddTarget(context.Context, *AddTargetRequest) (*Error, error)
- func (UnimplementedLoadBalancerServer) Create(context.Context, *CreateLoadBalancer) (*LoadBalancerInformation, error)
- func (UnimplementedLoadBalancerServer) DelTarget(context.Context, *DelTargetRequest) (*Error, error)
- func (UnimplementedLoadBalancerServer) Delete(context.Context, *LoadBalancerName) (*Error, error)
- func (UnimplementedLoadBalancerServer) GetLoadBalancer(context.Context, *LoadBalancerName) (*LoadBalancerInformation, error)
- func (UnimplementedLoadBalancerServer) GetLoadBalancers(*emptypb.Empty, LoadBalancer_GetLoadBalancersServer) error
- type UnsafeLoadBalancerServer
Constants ¶
const ( ErrSuccess = 0 ErrNoSuchLB = (1 << 0) ErrNoSuchService = (1 << 1) ErrNoSuchIP = (1 << 2) ErrAddDestinationFailed = (1 << 3) ErrDelDestinationFailed = (1 << 4) ErrTargetAlreadyMapped = (1 << 5) ErrTargetNotMapped = (1 << 6) ErrIPAMError = (1 << 7) )
Error codes that can appear in the Error.Code field
Variables ¶
var ( Protocol_name = map[int32]string{ 0: "TCP", 1: "UDP", } Protocol_value = map[string]int32{ "TCP": 0, "UDP": 1, } )
Enum value maps for Protocol.
var File_internal_loadbalancer_loadbalancer_proto protoreflect.FileDescriptor
var LoadBalancer_ServiceDesc = grpc.ServiceDesc{ ServiceName: "loadbalancer.LoadBalancer", HandlerType: (*LoadBalancerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetLoadBalancer", Handler: _LoadBalancer_GetLoadBalancer_Handler, }, { MethodName: "Create", Handler: _LoadBalancer_Create_Handler, }, { MethodName: "Delete", Handler: _LoadBalancer_Delete_Handler, }, { MethodName: "AddTarget", Handler: _LoadBalancer_AddTarget_Handler, }, { MethodName: "DelTarget", Handler: _LoadBalancer_DelTarget_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "GetLoadBalancers", Handler: _LoadBalancer_GetLoadBalancers_Handler, ServerStreams: true, }, }, Metadata: "internal/loadbalancer/loadbalancer.proto", }
LoadBalancer_ServiceDesc is the grpc.ServiceDesc for LoadBalancer service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterLoadBalancerServer ¶
func RegisterLoadBalancerServer(s grpc.ServiceRegistrar, srv LoadBalancerServer)
Types ¶
type AddTargetRequest ¶
type AddTargetRequest struct { LbName string `protobuf:"bytes,1,opt,name=lb_name,json=lbName,proto3" json:"lb_name,omitempty"` SrcPort int32 `protobuf:"varint,2,opt,name=srcPort,proto3" json:"srcPort,omitempty"` Target *Target `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"` // contains filtered or unexported fields }
func (*AddTargetRequest) Descriptor
deprecated
func (*AddTargetRequest) Descriptor() ([]byte, []int)
Deprecated: Use AddTargetRequest.ProtoReflect.Descriptor instead.
func (*AddTargetRequest) GetLbName ¶
func (x *AddTargetRequest) GetLbName() string
func (*AddTargetRequest) GetSrcPort ¶
func (x *AddTargetRequest) GetSrcPort() int32
func (*AddTargetRequest) GetTarget ¶
func (x *AddTargetRequest) GetTarget() *Target
func (*AddTargetRequest) ProtoMessage ¶
func (*AddTargetRequest) ProtoMessage()
func (*AddTargetRequest) ProtoReflect ¶
func (x *AddTargetRequest) ProtoReflect() protoreflect.Message
func (*AddTargetRequest) Reset ¶
func (x *AddTargetRequest) Reset()
func (*AddTargetRequest) String ¶
func (x *AddTargetRequest) String() string
type CreateLoadBalancer ¶
type CreateLoadBalancer struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // If an ip_addr is requested, try to use it. Otherwise, an unused IP will be allocated. IpAddr *string `protobuf:"bytes,2,opt,name=ip_addr,json=ipAddr,proto3,oneof" json:"ip_addr,omitempty"` // contains filtered or unexported fields }
func (*CreateLoadBalancer) Descriptor
deprecated
func (*CreateLoadBalancer) Descriptor() ([]byte, []int)
Deprecated: Use CreateLoadBalancer.ProtoReflect.Descriptor instead.
func (*CreateLoadBalancer) GetIpAddr ¶
func (x *CreateLoadBalancer) GetIpAddr() string
func (*CreateLoadBalancer) GetName ¶
func (x *CreateLoadBalancer) GetName() string
func (*CreateLoadBalancer) ProtoMessage ¶
func (*CreateLoadBalancer) ProtoMessage()
func (*CreateLoadBalancer) ProtoReflect ¶
func (x *CreateLoadBalancer) ProtoReflect() protoreflect.Message
func (*CreateLoadBalancer) Reset ¶
func (x *CreateLoadBalancer) Reset()
func (*CreateLoadBalancer) String ¶
func (x *CreateLoadBalancer) String() string
type DelTargetRequest ¶
type DelTargetRequest struct { LbName string `protobuf:"bytes,1,opt,name=lb_name,json=lbName,proto3" json:"lb_name,omitempty"` SrcPort int32 `protobuf:"varint,2,opt,name=srcPort,proto3" json:"srcPort,omitempty"` Target *Target `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"` // contains filtered or unexported fields }
func (*DelTargetRequest) Descriptor
deprecated
func (*DelTargetRequest) Descriptor() ([]byte, []int)
Deprecated: Use DelTargetRequest.ProtoReflect.Descriptor instead.
func (*DelTargetRequest) GetLbName ¶
func (x *DelTargetRequest) GetLbName() string
func (*DelTargetRequest) GetSrcPort ¶
func (x *DelTargetRequest) GetSrcPort() int32
func (*DelTargetRequest) GetTarget ¶
func (x *DelTargetRequest) GetTarget() *Target
func (*DelTargetRequest) ProtoMessage ¶
func (*DelTargetRequest) ProtoMessage()
func (*DelTargetRequest) ProtoReflect ¶
func (x *DelTargetRequest) ProtoReflect() protoreflect.Message
func (*DelTargetRequest) Reset ¶
func (x *DelTargetRequest) Reset()
func (*DelTargetRequest) String ¶
func (x *DelTargetRequest) String() string
type Error ¶
type Error struct { Code uint32 `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"` Message string `protobuf:"bytes,2,opt,name=Message,proto3" json:"Message,omitempty"` // contains filtered or unexported fields }
func (*Error) Descriptor
deprecated
func (*Error) GetMessage ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶
func (x *Error) ProtoReflect() protoreflect.Message
type Intf ¶
type Intf interface { LoadBalancerServer Close() Restore() error }
type LoadBalancerClient ¶
type LoadBalancerClient interface { // Get all information about all defined Load Balancers GetLoadBalancers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (LoadBalancer_GetLoadBalancersClient, error) // Get information about a specific Load Balancer. If no such name exists, return // an empty structure GetLoadBalancer(ctx context.Context, in *LoadBalancerName, opts ...grpc.CallOption) (*LoadBalancerInformation, error) Create(ctx context.Context, in *CreateLoadBalancer, opts ...grpc.CallOption) (*LoadBalancerInformation, error) Delete(ctx context.Context, in *LoadBalancerName, opts ...grpc.CallOption) (*Error, error) AddTarget(ctx context.Context, in *AddTargetRequest, opts ...grpc.CallOption) (*Error, error) DelTarget(ctx context.Context, in *DelTargetRequest, opts ...grpc.CallOption) (*Error, error) }
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.
func NewLoadBalancerClient ¶
func NewLoadBalancerClient(cc grpc.ClientConnInterface) LoadBalancerClient
type LoadBalancerInformation ¶
type LoadBalancerInformation struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` IpAddr string `protobuf:"bytes,2,opt,name=ip_addr,json=ipAddr,proto3" json:"ip_addr,omitempty"` Targets map[int32]*TargetList `` /* 156-byte string literal not displayed */ // contains filtered or unexported fields }
func (*LoadBalancerInformation) Descriptor
deprecated
func (*LoadBalancerInformation) Descriptor() ([]byte, []int)
Deprecated: Use LoadBalancerInformation.ProtoReflect.Descriptor instead.
func (*LoadBalancerInformation) GetIpAddr ¶
func (x *LoadBalancerInformation) GetIpAddr() string
func (*LoadBalancerInformation) GetName ¶
func (x *LoadBalancerInformation) GetName() string
func (*LoadBalancerInformation) GetTargets ¶
func (x *LoadBalancerInformation) GetTargets() map[int32]*TargetList
func (*LoadBalancerInformation) ProtoMessage ¶
func (*LoadBalancerInformation) ProtoMessage()
func (*LoadBalancerInformation) ProtoReflect ¶
func (x *LoadBalancerInformation) ProtoReflect() protoreflect.Message
func (*LoadBalancerInformation) Reset ¶
func (x *LoadBalancerInformation) Reset()
func (*LoadBalancerInformation) String ¶
func (x *LoadBalancerInformation) String() string
type LoadBalancerName ¶
type LoadBalancerName struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*LoadBalancerName) Descriptor
deprecated
func (*LoadBalancerName) Descriptor() ([]byte, []int)
Deprecated: Use LoadBalancerName.ProtoReflect.Descriptor instead.
func (*LoadBalancerName) GetName ¶
func (x *LoadBalancerName) GetName() string
func (*LoadBalancerName) ProtoMessage ¶
func (*LoadBalancerName) ProtoMessage()
func (*LoadBalancerName) ProtoReflect ¶
func (x *LoadBalancerName) ProtoReflect() protoreflect.Message
func (*LoadBalancerName) Reset ¶
func (x *LoadBalancerName) Reset()
func (*LoadBalancerName) String ¶
func (x *LoadBalancerName) String() string
type LoadBalancerServer ¶
type LoadBalancerServer interface { // Get all information about all defined Load Balancers GetLoadBalancers(*emptypb.Empty, LoadBalancer_GetLoadBalancersServer) error // Get information about a specific Load Balancer. If no such name exists, return // an empty structure GetLoadBalancer(context.Context, *LoadBalancerName) (*LoadBalancerInformation, error) Create(context.Context, *CreateLoadBalancer) (*LoadBalancerInformation, error) Delete(context.Context, *LoadBalancerName) (*Error, error) AddTarget(context.Context, *AddTargetRequest) (*Error, error) DelTarget(context.Context, *DelTargetRequest) (*Error, error) // contains filtered or unexported methods }
LoadBalancerServer is the server API for LoadBalancer service. All implementations must embed UnimplementedLoadBalancerServer for forward compatibility
type LoadBalancer_GetLoadBalancersClient ¶
type LoadBalancer_GetLoadBalancersClient interface { Recv() (*LoadBalancerInformation, error) grpc.ClientStream }
type LoadBalancer_GetLoadBalancersServer ¶
type LoadBalancer_GetLoadBalancersServer interface { Send(*LoadBalancerInformation) error grpc.ServerStream }
type Protocol ¶
type Protocol int32
func (Protocol) Descriptor ¶
func (Protocol) Descriptor() protoreflect.EnumDescriptor
func (Protocol) EnumDescriptor
deprecated
func (Protocol) Number ¶
func (x Protocol) Number() protoreflect.EnumNumber
func (Protocol) Type ¶
func (Protocol) Type() protoreflect.EnumType
type Target ¶
type Target struct { Protocol Protocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=loadbalancer.Protocol" json:"protocol,omitempty"` DstIP string `protobuf:"bytes,2,opt,name=dstIP,proto3" json:"dstIP,omitempty"` DstPort int32 `protobuf:"varint,3,opt,name=dstPort,proto3" json:"dstPort,omitempty"` // contains filtered or unexported fields }
func (*Target) Descriptor
deprecated
func (*Target) GetDstPort ¶
func (*Target) GetProtocol ¶
func (*Target) ProtoMessage ¶
func (*Target) ProtoMessage()
func (*Target) ProtoReflect ¶
func (x *Target) ProtoReflect() protoreflect.Message
type TargetList ¶
type TargetList struct { Target []*Target `protobuf:"bytes,1,rep,name=target,proto3" json:"target,omitempty"` // contains filtered or unexported fields }
func (*TargetList) Descriptor
deprecated
func (*TargetList) Descriptor() ([]byte, []int)
Deprecated: Use TargetList.ProtoReflect.Descriptor instead.
func (*TargetList) GetTarget ¶
func (x *TargetList) GetTarget() []*Target
func (*TargetList) ProtoMessage ¶
func (*TargetList) ProtoMessage()
func (*TargetList) ProtoReflect ¶
func (x *TargetList) ProtoReflect() protoreflect.Message
func (*TargetList) Reset ¶
func (x *TargetList) Reset()
func (*TargetList) String ¶
func (x *TargetList) String() string
type UnimplementedLoadBalancerServer ¶
type UnimplementedLoadBalancerServer struct { }
UnimplementedLoadBalancerServer must be embedded to have forward compatible implementations.
func (UnimplementedLoadBalancerServer) AddTarget ¶
func (UnimplementedLoadBalancerServer) AddTarget(context.Context, *AddTargetRequest) (*Error, error)
func (UnimplementedLoadBalancerServer) Create ¶
func (UnimplementedLoadBalancerServer) Create(context.Context, *CreateLoadBalancer) (*LoadBalancerInformation, error)
func (UnimplementedLoadBalancerServer) DelTarget ¶
func (UnimplementedLoadBalancerServer) DelTarget(context.Context, *DelTargetRequest) (*Error, error)
func (UnimplementedLoadBalancerServer) Delete ¶
func (UnimplementedLoadBalancerServer) Delete(context.Context, *LoadBalancerName) (*Error, error)
func (UnimplementedLoadBalancerServer) GetLoadBalancer ¶
func (UnimplementedLoadBalancerServer) GetLoadBalancer(context.Context, *LoadBalancerName) (*LoadBalancerInformation, error)
func (UnimplementedLoadBalancerServer) GetLoadBalancers ¶
func (UnimplementedLoadBalancerServer) GetLoadBalancers(*emptypb.Empty, LoadBalancer_GetLoadBalancersServer) error
type UnsafeLoadBalancerServer ¶
type UnsafeLoadBalancerServer interface {
// contains filtered or unexported methods
}
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.