Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultNotFound = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { log.Infof("Not found: %v %v", r.Method, r.URL) w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusNotFound) fmt.Fprint(w, `{"error":"not found"}`) })
DefaultNotFound is an HTTP handler that returns simple 404 Not Found response.
Functions ¶
This section is empty.
Types ¶
type FileDescriptor ¶
func (*FileDescriptor) String ¶
func (fd *FileDescriptor) String() string
func (*FileDescriptor) ToListener ¶
func (fd *FileDescriptor) ToListener() (net.Listener, error)
type NewProxyFn ¶
type Options ¶
type Options struct {
MetricsClient metrics.Client
DialTimeout time.Duration
ReadTimeout time.Duration
WriteTimeout time.Duration
MaxHeaderBytes int
DefaultListener *engine.Listener
TrustForwardHeader bool
Files []*FileDescriptor
TimeProvider timetools.TimeProvider
NotFoundMiddleware plugin.Middleware
Router router.Router
IncomingConnectionTracker conntracker.ConnectionTracker
FrontendListeners plugin.FrontendListeners
CacheProvider cacheprovider.T
}
type Proxy ¶
type Proxy interface {
engine.StatsProvider
Init(snapshot engine.Snapshot) error
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)
}
Click to show internal directories.
Click to hide internal directories.