Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware(logger logrus.FieldLogger) httpwares.Middleware
Middleware reports last Kedge proxy error on each HTTP request (if spotted) by incrementing metrics and producing log line.
func ReqWrappedWithTracker ¶
ReqWrappedWithTracker returns copy of HTTP request with tracker in context.
func SetKedgeErrorHeaders ¶
SetKedgeErrorHeaders adds Kedge Error headers useful to immediately see kedge error on HTTP response. NOTE: This method can be invoked only before resp.WriteHeader(...)
func SetWinchErrorHeaders ¶
SetWinchErrorHeaders adds winch Error headers useful to immediately see winch error on HTTP response. NOTE: This method can be invoked only before resp.WriteHeader(...)
Types ¶
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker is used to report an error spotted by kedge itself (error that happen when request was not succesfully proxied because of some reason). It covers only first seen error and warns when ReportError is called twice on the same request.
For Kedge flow there will be only one tracker living for each request shared by both handler and reverse proxy tripperwares. This is thanks of reverse proxy preserving request's context.
func Extract ¶
ExtractInbound returns existing tracker or does lazy creation of new one to be used. NOTE that still reqWrappedWithTracker function needs to be invoked to save this tracker into request's context. This is due to cost of copying context and request around to just add a value to context.