Documentation ¶
Overview ¶
Package proxy implements the layer-3 network proxy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoadBalancer ¶
type LoadBalancer interface { // LoadBalance takes an incoming request and figures out where to route it to. // Determination is based on destination service (for example, 'mysql') as // well as the source making the connection. LoadBalance(service string, srcAddr net.Addr) (string, error) }
LoadBalancer represents a load balancer that decides where to route the incoming services for a particular service to.
type LoadBalancerRR ¶
type LoadBalancerRR struct {
// contains filtered or unexported fields
}
LoadBalancerRR is a round-robin load balancer. It implements LoadBalancer.
func NewLoadBalancerRR ¶
func NewLoadBalancerRR() *LoadBalancerRR
NewLoadBalancerRR returns a newly created and correctly initialized instance of LoadBalancerRR.
func (LoadBalancerRR) LoadBalance ¶
LoadBalance selects an endpoint of the service by round-robin algorithm.
func (LoadBalancerRR) OnUpdate ¶
func (impl LoadBalancerRR) OnUpdate(endpoints []api.Endpoints)
OnUpdate updates the registered endpoints with the new endpoint information, removes the registered endpoints no longer present in the provided endpoints.
type Proxier ¶
type Proxier struct {
// contains filtered or unexported fields
}
Proxier is a simple proxy for tcp connections between a localhost:lport and services that provide the actual implementations.
func NewProxier ¶
func NewProxier(loadBalancer LoadBalancer) *Proxier
NewProxier returns a newly created and correctly initialized instance of Proxier.
func (Proxier) AcceptHandler ¶
AcceptHandler begins accepting incoming connections from listener and proxying the connections to the load-balanced endpoints. It never returns.
Directories ¶
Path | Synopsis |
---|---|
Package config provides decoupling between various configuration sources (etcd, files,...) and the pieces that actually care about them (loadbalancer, proxy).
|
Package config provides decoupling between various configuration sources (etcd, files,...) and the pieces that actually care about them (loadbalancer, proxy). |