proxy

package
v0.0.0-...-c2f4907 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleRuntimeStats

func HandleRuntimeStats() http.Handler

func ServeRuntimeStats

func ServeRuntimeStats(pattern string)

Types

type Director

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

func (*Director) RoundTrip

func (director *Director) RoundTrip(req *http.Request) (*http.Response, error)

type Endpoint

type Endpoint struct {
	Service string
	Host    string
	// contains filtered or unexported fields
}

func (*Endpoint) Active

func (endpoint *Endpoint) Active() bool

func (*Endpoint) CheckConnection

func (endpoint *Endpoint) CheckConnection() error

func (*Endpoint) ConfigureUrl

func (endpoint *Endpoint) ConfigureUrl(u *url.URL)

func (*Endpoint) Errors

func (endpoint *Endpoint) Errors() int

func (*Endpoint) Load

func (endpoint *Endpoint) Load() int

func (*Endpoint) LocalPort

func (endpoint *Endpoint) LocalPort() (string, error)

Return empty string if the endpoint is not the local host

func (*Endpoint) Name

func (endpoint *Endpoint) Name() string

func (*Endpoint) Overloaded

func (endpoint *Endpoint) Overloaded() bool

func (*Endpoint) Reqs

func (endpoint *Endpoint) Reqs() uint

func (*Endpoint) RoundTrip

func (endpoint *Endpoint) RoundTrip(roundTripper func() error)

func (*Endpoint) String

func (endpoint *Endpoint) String() string

func (*Endpoint) TestActive

func (endpoint *Endpoint) TestActive()

func (*Endpoint) WaitActive

func (endpoint *Endpoint) WaitActive() <-chan *Endpoint

type EndpointCollection

type EndpointCollection []*Endpoint

func (EndpointCollection) EmergencyGet

func (col EndpointCollection) EmergencyGet() *Endpoint

func (EndpointCollection) Get

func (col EndpointCollection) Get() *Endpoint

type EndpointStats

type EndpointStats struct {
	Stats
	Endpoints map[string]Stats
}

type IsolationProxy

type IsolationProxy struct {
	Registry Registry
	// contains filtered or unexported fields
}

func NewIsolationProxy

func NewIsolationProxy(registry Registry, dialTimeout time.Duration) *IsolationProxy

func (*IsolationProxy) Handle

func (proxy *IsolationProxy) Handle(serviceName, localEndpoint string) error

func (*IsolationProxy) HandleStats

func (proxy *IsolationProxy) HandleStats() http.Handler

func (*IsolationProxy) ServeStats

func (proxy *IsolationProxy) ServeStats(pattern string)

func (*IsolationProxy) Stats

func (proxy *IsolationProxy) Stats() ProxyStats

type LocalRegistry

type LocalRegistry map[string]EndpointCollection

Alternative implementation would use a centralized registry server

func (LocalRegistry) Add

func (reg LocalRegistry) Add(serviceName string, endpoint *Endpoint)

func (LocalRegistry) Endpoints

func (reg LocalRegistry) Endpoints(serviceName string) (endpoints EndpointCollection, err error)

func (LocalRegistry) Services

func (reg LocalRegistry) Services() []string

type ProxyStats

type ProxyStats map[string]*EndpointStats

type Registry

type Registry interface {
	Endpoints(serviceName string) (endpoints EndpointCollection, err error)
	Services() []string
}

type RuntimeStats

type RuntimeStats struct {
	Goroutines int
}

func GetRuntimeStats

func GetRuntimeStats() (result RuntimeStats)

type Stats

type Stats struct {
	Requests    uint
	Load        int
	AvgDuration string
	Active      bool
	Errors      int
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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