proxy

package
v0.0.0-...-628bcb8 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2014 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 1 more Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VcapCookieId    = "__VCAP_ID__"
	StickyCookieKey = "JSESSIONID"
)

Variables

This section is empty.

Functions

func NewMaxLatencyWriter

func NewMaxLatencyWriter(dst writeFlusher, latency time.Duration) *maxLatencyWriter

Types

type LookupRegistry

type LookupRegistry interface {
	Lookup(uri route.Uri) (*route.Endpoint, bool)
	LookupByPrivateInstanceId(uri route.Uri, p string) (*route.Endpoint, bool)
}

type Proxy

type Proxy interface {
	ServeHTTP(responseWriter http.ResponseWriter, request *http.Request)
}

func NewProxy

func NewProxy(args ProxyArgs) Proxy

type ProxyArgs

type ProxyArgs struct {
	EndpointTimeout time.Duration
	Ip              string
	TraceKey        string
	Registry        LookupRegistry
	Reporter        Reporter
	Logger          access_log.AccessLogger
}

type Reporter

type Reporter interface {
	CaptureBadRequest(req *http.Request)
	CaptureBadGateway(req *http.Request)
	CaptureRoutingRequest(b *route.Endpoint, req *http.Request)
	CaptureRoutingResponse(b *route.Endpoint, res *http.Response, t time.Time, d time.Duration)
}

type RequestHandler

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

func NewRequestHandler

func NewRequestHandler(request *http.Request, response http.ResponseWriter) RequestHandler

func (*RequestHandler) HandleBadGateway

func (h *RequestHandler) HandleBadGateway(err error)

func (*RequestHandler) HandleHeartbeat

func (h *RequestHandler) HandleHeartbeat()

func (*RequestHandler) HandleHttpRequest

func (h *RequestHandler) HandleHttpRequest(transport *http.Transport, endpoint *route.Endpoint) (*http.Response, error)

func (*RequestHandler) HandleMissingRoute

func (h *RequestHandler) HandleMissingRoute()

func (*RequestHandler) HandleTcpRequest

func (h *RequestHandler) HandleTcpRequest(endpoint *route.Endpoint)

func (*RequestHandler) HandleUnsupportedProtocol

func (h *RequestHandler) HandleUnsupportedProtocol()

func (*RequestHandler) HandleWebSocketRequest

func (h *RequestHandler) HandleWebSocketRequest(endpoint *route.Endpoint)

func (*RequestHandler) SetTraceHeaders

func (h *RequestHandler) SetTraceHeaders(routerIp, addr string)

func (*RequestHandler) WriteResponse

func (h *RequestHandler) WriteResponse(endpointResponse *http.Response) int64

Jump to

Keyboard shortcuts

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