Documentation
¶
Overview ¶
Package loadbalancer contains all logic related with the loadbalancer +groupName=pkg
Index ¶
- Constants
- Variables
- type Backend
- type BackendID
- type FEPortName
- type ID
- type L3n4Addr
- func (a *L3n4Addr) DeepCopy() *L3n4Addr
- func (in *L3n4Addr) DeepCopyInto(out *L3n4Addr)
- func (a *L3n4Addr) GetModel() *models.FrontendAddress
- func (a L3n4Addr) Hash() string
- func (a *L3n4Addr) IsIPv6() bool
- func (a *L3n4Addr) String() string
- func (a *L3n4Addr) StringID() string
- func (a *L3n4Addr) StringWithProtocol() string
- type L3n4AddrID
- type L4Addr
- type L4Type
- type SVC
- type SVCType
- type ServiceFlags
- type ServiceID
Constants ¶
const ( SVCTypeNone = SVCType("NONE") SVCTypeClusterIP = SVCType("ClusterIP") SVCTypeNodePort = SVCType("NodePort") SVCTypeExternalIPs = SVCType("ExternalIPs") )
const ( NONE = L4Type("NONE") // TCP type. TCP = L4Type("TCP") // UDP type. UDP = L4Type("UDP") )
Variables ¶
var ( // AllProtocols is the list of all supported L4 protocols AllProtocols = []L4Type{TCP, UDP} )
Functions ¶
This section is empty.
Types ¶
type Backend ¶
Backend represents load balancer backend.
func NewBackend ¶
NewBackend creates the Backend struct instance from given params.
func NewBackendFromBackendModel ¶
func NewBackendFromBackendModel(base *models.BackendAddress) (*Backend, error)
func (*Backend) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Backend.
func (*Backend) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Backend) GetBackendModel ¶
func (b *Backend) GetBackendModel() *models.BackendAddress
type L3n4Addr ¶
L3n4Addr is used to store, as an unique L3+L4 address in the KVStore.
func NewL3n4Addr ¶
NewL3n4Addr creates a new L3n4Addr.
func NewL3n4AddrFromBackendModel ¶
func NewL3n4AddrFromBackendModel(base *models.BackendAddress) (*L3n4Addr, error)
func NewL3n4AddrFromModel ¶
func NewL3n4AddrFromModel(base *models.FrontendAddress) (*L3n4Addr, error)
func (*L3n4Addr) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*L3n4Addr) GetModel ¶
func (a *L3n4Addr) GetModel() *models.FrontendAddress
func (*L3n4Addr) IsIPv6 ¶
IsIPv6 returns true if the IP address in the given L3n4Addr is IPv6 or not.
func (*L3n4Addr) String ¶
String returns the L3n4Addr in the "IPv4:Port" format for IPv4 and "[IPv6]:Port" format for IPv6.
func (*L3n4Addr) StringID ¶
StringID returns the L3n4Addr as string to be used for unique identification
func (*L3n4Addr) StringWithProtocol ¶
StringWithProtocol returns the L3n4Addr in the "IPv4:Port/Protocol" format for IPv4 and "[IPv6]:Port/Protocol" format for IPv6.
type L3n4AddrID ¶
L3n4AddrID is used to store, as an unique L3+L4 plus the assigned ID, in the KVStore.
func NewL3n4AddrID ¶
NewL3n4AddrID creates a new L3n4AddrID.
func (*L3n4AddrID) DeepCopy ¶
func (in *L3n4AddrID) DeepCopy() *L3n4AddrID
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new L3n4AddrID.
func (*L3n4AddrID) DeepCopyInto ¶
func (in *L3n4AddrID) DeepCopyInto(out *L3n4AddrID)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*L3n4AddrID) Equals ¶ added in v1.6.0
func (l *L3n4AddrID) Equals(o *L3n4AddrID) bool
Equals checks equality of both given addresses.
func (*L3n4AddrID) IsIPv6 ¶
func (l *L3n4AddrID) IsIPv6() bool
IsIPv6 returns true if the IP address in L3n4Addr's L3n4AddrID is IPv6 or not.
type L4Addr ¶
L4Addr is an abstraction for the backend port with a L4Type, usually tcp or udp, and the Port number.
func (*L4Addr) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SVC ¶
type SVC struct { Frontend L3n4AddrID // SVC frontend addr and an allocated ID Backends []Backend // List of service backends Type SVCType // Service type Name string // Service name Namespace string // Service namespace }
SVC is a structure for storing service details.
func (*SVC) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SVC.
func (*SVC) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ServiceFlags ¶
type ServiceFlags uint8
ServiceFlags is the datapath representation of the service flags that can be used.
func CreateSvcFlag ¶ added in v1.7.0
func CreateSvcFlag(svcTypes ...SVCType) ServiceFlags
CreateSvcFlag returns the ServiceFlags for all given SVCTypes.
func (ServiceFlags) IsSvcType ¶ added in v1.7.0
func (s ServiceFlags) IsSvcType(svcType SVCType) bool
IsSvcType returns true if the serviceFlags is the given SVCType.
func (ServiceFlags) String ¶
func (s ServiceFlags) String() string
String returns the string implementation of ServiceFlags.
func (ServiceFlags) UInt8 ¶ added in v1.7.0
func (s ServiceFlags) UInt8() uint8
UInt8 returns the UInt8 representation of the ServiceFlags.