proxy

package
v0.0.0-...-54d1e7e Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2014 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyBytes

func CopyBytes(in, out *net.TCPConn)

func ProxyConnection

func ProxyConnection(in, out *net.TCPConn)

Create a bidirectional byte shuffler. Copies bytes to/from each connection.

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

type LoadBalancerRR

type LoadBalancerRR struct {
	// contains filtered or unexported fields
}

func NewLoadBalancerRR

func NewLoadBalancerRR() *LoadBalancerRR

func (LoadBalancerRR) FilterValidEndpoints

func (impl LoadBalancerRR) FilterValidEndpoints(endpoints []string) []string

func (LoadBalancerRR) IsValid

func (impl LoadBalancerRR) IsValid(spec string) bool

func (LoadBalancerRR) LoadBalance

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

func (LoadBalancerRR) OnUpdate

func (impl LoadBalancerRR) OnUpdate(endpoints []api.Endpoints)

type Proxier

type Proxier struct {
	// contains filtered or unexported fields
}

func NewProxier

func NewProxier(loadBalancer LoadBalancer) *Proxier

func (Proxier) AcceptHandler

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

func (Proxier) AddService

func (proxier Proxier) AddService(service string, port int) error

AddService starts listening for a new service on a given port.

func (Proxier) OnUpdate

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

Directories

Path Synopsis
Config provides decoupling between various configuration sources (etcd, files,...) and the pieces that actually care about them (loadbalancer, proxy).
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