Documentation ¶
Index ¶
- func GetLoadBalancerName(ing *v1.Ingress) string
- func IsActiveStatus(status string) bool
- type LBManagerInterface
- type LoadBalancer
- func (lb *LoadBalancer) Copy() *LoadBalancer
- func (lb *LoadBalancer) Find(name string) bool
- func (lb *LoadBalancer) Get() (*serverscom.L7LoadBalancer, error)
- func (lb *LoadBalancer) IsChanged(newInput *serverscom.L7LoadBalancerUpdateInput) bool
- func (lb *LoadBalancer) MarkAsDeleted()
- func (lb *LoadBalancer) Sync() (*serverscom.L7LoadBalancer, error)
- func (lb *LoadBalancer) UpdateInput(newInput *serverscom.L7LoadBalancerUpdateInput)
- type Manager
- func (m *Manager) DeleteLoadBalancer(name string) error
- func (m *Manager) GetIds() []string
- func (m *Manager) GetLoadBalancer(name string) (*serverscom.L7LoadBalancer, error)
- func (m *Manager) HasRegistration(name string) bool
- func (m *Manager) NewLoadBalancer(input *serverscom.L7LoadBalancerCreateInput) (*serverscom.L7LoadBalancer, error, bool)
- func (m *Manager) TranslateIngressToLB(ingress *networkv1.Ingress, sslCerts map[string]string) (*serverscom.L7LoadBalancerCreateInput, error)
- func (m *Manager) UpdateLoadBalancer(input *serverscom.L7LoadBalancerUpdateInput) (*serverscom.L7LoadBalancer, error, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLoadBalancerName ¶
GetLoadBalancerName compose a load balancer name from ingress object
func IsActiveStatus ¶ added in v1.0.2
IsActiveStatus determines if lb has an active status
Types ¶
type LBManagerInterface ¶
type LBManagerInterface interface { HasRegistration(name string) bool NewLoadBalancer(input *serverscom.L7LoadBalancerCreateInput) (*serverscom.L7LoadBalancer, error, bool) DeleteLoadBalancer(name string) error UpdateLoadBalancer(input *serverscom.L7LoadBalancerUpdateInput) (*serverscom.L7LoadBalancer, error, bool) GetIds() []string TranslateIngressToLB(ingress *networkv1.Ingress, sslCerts map[string]string) (*serverscom.L7LoadBalancerCreateInput, error) GetLoadBalancer(name string) (*serverscom.L7LoadBalancer, error) }
ManagerInterface describes an interface to manage load balancers
type LoadBalancer ¶
type LoadBalancer struct {
// contains filtered or unexported fields
}
LoadBalancer represents a load balancer object for manager
func NewLoadBalancer ¶
func NewLoadBalancer(lBService serverscom.LoadBalancersService, input *serverscom.L7LoadBalancerCreateInput) *LoadBalancer
NewLoadBalancer creates a new load balancer object
func (*LoadBalancer) Copy ¶
func (lb *LoadBalancer) Copy() *LoadBalancer
Copy makes a copy of load balancer
func (*LoadBalancer) Find ¶
func (lb *LoadBalancer) Find(name string) bool
Find finds load balancer in portal and sets lb id if found
func (*LoadBalancer) Get ¶ added in v1.0.2
func (lb *LoadBalancer) Get() (*serverscom.L7LoadBalancer, error)
Get gets load balancer from api
func (*LoadBalancer) IsChanged ¶
func (lb *LoadBalancer) IsChanged(newInput *serverscom.L7LoadBalancerUpdateInput) bool
IsChanged returns true if newInput don't match currentInput
func (*LoadBalancer) MarkAsDeleted ¶
func (lb *LoadBalancer) MarkAsDeleted()
MarkAsDeleted marks load balancer as deleted
func (*LoadBalancer) Sync ¶
func (lb *LoadBalancer) Sync() (*serverscom.L7LoadBalancer, error)
Sync create/update/delete load balancer depending on it state
func (*LoadBalancer) UpdateInput ¶
func (lb *LoadBalancer) UpdateInput(newInput *serverscom.L7LoadBalancerUpdateInput)
UpdateInput saves current input to previous and updates current input with newInput
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager represents a load balancer manager
func NewManager ¶
func NewManager(client *serverscom.Client, store store.Storer) *Manager
NewManager creates a load balancer manager
func (*Manager) DeleteLoadBalancer ¶
DeleteLoadBalancer deletes load balancer from portal and manager
func (*Manager) GetLoadBalancer ¶ added in v1.0.2
func (m *Manager) GetLoadBalancer(name string) (*serverscom.L7LoadBalancer, error)
GetLoadBalancer get load balancer from api
func (*Manager) HasRegistration ¶
HasRegistration checks if lb manager has load balancer with specified name
func (*Manager) NewLoadBalancer ¶
func (m *Manager) NewLoadBalancer(input *serverscom.L7LoadBalancerCreateInput) (*serverscom.L7LoadBalancer, error, bool)
NewLoadBalancer creates a new load balancer in portal from input if it doesn't exists in portal, otherwise update it Updates load balancer state in manager
func (*Manager) TranslateIngressToLB ¶
func (m *Manager) TranslateIngressToLB(ingress *networkv1.Ingress, sslCerts map[string]string) (*serverscom.L7LoadBalancerCreateInput, error)
TranslateIngressToLB maps an Ingress to L7 LB object and fills annotations
func (*Manager) UpdateLoadBalancer ¶
func (m *Manager) UpdateLoadBalancer(input *serverscom.L7LoadBalancerUpdateInput) (*serverscom.L7LoadBalancer, error, bool)
UpdateLoadBalancer updates load balancer in portal and manager.