proxy

package
v0.8.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2014 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Metrics = "_metrics"
	PerfMon = "_perfMon"
)

Variables

This section is empty.

Functions

func New

func New(id int, o Options) (*mux, error)

Types

type FileDescriptor

type FileDescriptor struct {
	Address engine.Address
	File    *os.File
}

func (*FileDescriptor) String

func (fd *FileDescriptor) String() string

func (*FileDescriptor) ToListener

func (fd *FileDescriptor) ToListener() (net.Listener, error)

type NewProxyFn

type NewProxyFn func(id int) (Proxy, error)

type NotFound

type NotFound struct {
}

NotFound is a generic http.Handler for request

func (*NotFound) ServeHTTP

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

ServeHTTP returns a simple 404 Not found response

type Options

type Options struct {
	MetricsClient   metrics.Client
	DialTimeout     time.Duration
	ReadTimeout     time.Duration
	WriteTimeout    time.Duration
	MaxHeaderBytes  int
	DefaultListener *engine.Listener
	Files           []*FileDescriptor
	TimeProvider    timetools.TimeProvider
}

type Proxy

type Proxy interface {
	engine.StatsProvider

	UpsertHost(engine.Host) error
	DeleteHost(engine.HostKey) error

	UpsertListener(engine.Listener) error
	DeleteListener(engine.ListenerKey) error

	UpsertBackend(engine.Backend) error
	DeleteBackend(engine.BackendKey) error

	UpsertFrontend(engine.Frontend) error
	DeleteFrontend(engine.FrontendKey) error

	UpsertMiddleware(engine.FrontendKey, engine.Middleware) error
	DeleteMiddleware(engine.MiddlewareKey) error

	UpsertServer(engine.BackendKey, engine.Server) error
	DeleteServer(engine.ServerKey) error

	// TakeFiles takes file descriptors representing sockets in listening state to start serving on them
	// instead of binding. This is nessesary if the child process needs to inherit sockets from the parent
	// (e.g. for graceful restarts)
	TakeFiles([]*FileDescriptor) error

	// GetFiles exports listening socket's underlying dupped file descriptors, so they can later
	// be passed to child process or to another Server
	GetFiles() ([]*FileDescriptor, error)

	Start() error
	Stop(wait bool)
}

type RTWatcher

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

RTWatcher watches runtime metrics

func NewWatcher

func NewWatcher(next http.Handler) (*RTWatcher, error)

func (*RTWatcher) ServeHTTP

func (rt *RTWatcher) ServeHTTP(w http.ResponseWriter, req *http.Request)

type Reporter

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

Reporter reports real time metrics to the Statsd client

func NewReporter

func NewReporter(next http.Handler, c metrics.Client, fk engine.FrontendKey) *Reporter

func (*Reporter) ServeHTTP

func (rp *Reporter) ServeHTTP(w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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