proxy

package
v0.0.0-...-f39c977 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2018 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthCheckResponse

type HealthCheckResponse struct {
	Status      string
	CPULoad     int
	MemoryUsage int
}

type Proxy

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

Proxy is the core part of HA proxy, it maintains the list of server end points and has the right to pick active server.

func NewProxy

func NewProxy(endPoints []string, healthCheckInterval, healthCheckTimeout time.Duration) *Proxy

NewProxy creates and only creates single instance of Proxy object with given list of server end points, health check interval and timeout.

func (*Proxy) HealthCheck

func (p *Proxy) HealthCheck()

HealthCheck sends out health check requests to all server end points.

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Proxy) UpdateAddress

func (p *Proxy) UpdateAddress(name, address string)

UpdateAddress updates the address with given information.

Jump to

Keyboard shortcuts

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