proxy

package
v0.0.0-...-7b8bf0e Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2015 License: Apache-2.0 Imports: 25 Imported by: 2

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func New

func New(id int, st stapler.Stapler, o Options) (*mux, error)

Types

type DefaultNotFound

type DefaultNotFound struct {
}

NotFound is a generic http.Handler for request

func (*DefaultNotFound) ServeHTTP

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

ServeHTTP returns a simple 404 Not found response

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 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
	NotFoundMiddleware    plugin.Middleware
	NoServersErrorHandler utils.ErrorHandler
}

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 and aggregates runtime metrics

func NewWatcher

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

func (*RTWatcher) ServeHTTP

func (rt *RTWatcher) 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