proxy

package
v0.0.0-...-6eef5cf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2014 License: Apache-2.0 Imports: 10 Imported by: 0

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

func (impl LoadBalancerRR) LoadBalance(service string, srcAddr net.Addr) (string, error)

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

func (proxier Proxier) AcceptHandler(service string, listener net.Listener)

AcceptHandler begins accepting incoming connections from listener and proxying the connections to the load-balanced endpoints. It never returns.

func (Proxier) OnUpdate

func (proxier Proxier) OnUpdate(services []api.Service)

OnUpdate receives update notices for the updated services and start listening newly added services. It implements "github.com/GoogleCloudPlatform/kubernetes/pkg/proxy/config".ServiceConfigHandler.OnUpdate.

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).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL