Documentation ¶
Index ¶
- Variables
- type StdHandler
- type T
- func (fe *T) AppendAllBeSrvRTMsTo(aggregates map[backend.SrvURLKey]rtmcollect.BeSrvEntry)
- func (fe *T) AppendBeSrvRTMTo(aggregate *memmetrics.RTMetrics, beSrvURLKey backend.SrvURLKey)
- func (fe *T) AppendRTMTo(aggregate *memmetrics.RTMetrics)
- func (fe *T) BackendKey() engine.BackendKey
- func (fe *T) CfgWithStats() (engine.Frontend, bool, error)
- func (fe *T) DeleteMiddleware(mwKey engine.MiddlewareKey)
- func (fe *T) Key() engine.FrontendKey
- func (fe *T) OnBackendMutated()
- func (fe *T) Route() string
- func (fe *T) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (fe *T) String() string
- func (fe *T) Update(feCfg engine.Frontend, be *backend.T) error
- func (fe *T) UpsertMiddleware(mwCfg engine.Middleware)
Constants ¶
This section is empty.
Variables ¶
var DefaultHandler utils.ErrorHandler = &StdHandler{}
DefaultHandler default error handler.
Functions ¶
This section is empty.
Types ¶
type StdHandler ¶ added in v0.9.2
type StdHandler struct{}
StdHandler Standard error handler.
func (*StdHandler) ServeHTTP ¶ added in v0.9.2
func (e *StdHandler) ServeHTTP(w http.ResponseWriter, req *http.Request, err error)
type T ¶
type T struct {
// contains filtered or unexported fields
}
T represents a frontend instance. It implements http.Handler interface to be used with an http.Server. The implementation takes measures to collect round trip metrics for the frontend and all servers of an associated backend.
func New ¶
func New(cfg engine.Frontend, be *backend.T, opts proxy.Options, mwCfgs map[engine.MiddlewareKey]engine.Middleware, listeners plugin.FrontendListeners, ) *T
New returns a new frontend instance.
func (*T) AppendAllBeSrvRTMsTo ¶
func (fe *T) AppendAllBeSrvRTMsTo(aggregates map[backend.SrvURLKey]rtmcollect.BeSrvEntry)
AppendAllBeSrvRTMsTo appends round-trip metrics of all backend servers of the backend associated with the frontend to the respective aggregates. If an aggregate for a server is missing from the map then a new one is created.
func (*T) AppendBeSrvRTMTo ¶
func (fe *T) AppendBeSrvRTMTo(aggregate *memmetrics.RTMetrics, beSrvURLKey backend.SrvURLKey)
AppendBeSrvRTMTo appends round-trip metrics of a backend server to aggregate. It does nothing if a server if the specified URL key does not exist.
func (*T) AppendRTMTo ¶
func (fe *T) AppendRTMTo(aggregate *memmetrics.RTMetrics)
AppendRTMTo appends frontend round-trip metrics to an aggregate.
func (*T) BackendKey ¶
func (fe *T) BackendKey() engine.BackendKey
BackendKey returns the storage key of an associated backend.
func (*T) CfgWithStats ¶
CfgWithStats returns the frontend storage config with associated round trip stats.
func (*T) DeleteMiddleware ¶
func (fe *T) DeleteMiddleware(mwKey engine.MiddlewareKey)
DeleteMiddleware deletes a middleware if there is one with the specified storage key or does nothing otherwise.
func (*T) OnBackendMutated ¶
func (fe *T) OnBackendMutated()
OnBackendMutated should be called when state of the associated backend is changed, e.g. when a new backend server is added or something like that.
func (*T) Route ¶
Route returns HTTP path. It should be used to configure an HTTP router to forward requests coming to the path to this frontend instance.
func (*T) ServeHTTP ¶
func (fe *T) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements http.Handler.
func (*T) UpsertMiddleware ¶
func (fe *T) UpsertMiddleware(mwCfg engine.Middleware)
UpsertMiddleware upserts a middleware.