Documentation ¶
Index ¶
- Constants
- func DebugTrace(format propagation.HTTPFormat, key string) func(handler http.Handler) http.Handler
- func NewRecovery(recoverFunc func(w http.ResponseWriter, r *http.Request, err interface{})) func(http.Handler) http.Handler
- func RequestID(handler http.Handler) http.Handler
- type HostMatcher
- type Logger
- type Stats
- type StatsTagger
Constants ¶
View Source
const ( // DebugTraceHeader is the header key used for detecting if // trace should be force sampled and returned in the response DebugTraceHeader = "X-Debug-Trace" )
Variables ¶
This section is empty.
Functions ¶
func DebugTrace ¶
func DebugTrace(format propagation.HTTPFormat, key string) func(handler http.Handler) http.Handler
DebugTrace is a middleware that allows debugging requests by providing the Trace ID back to the caller in the same header in the response
func NewRecovery ¶
func NewRecovery(recoverFunc func(w http.ResponseWriter, r *http.Request, err interface{})) func(http.Handler) http.Handler
NewRecovery creates a new instance of Recovery
Types ¶
type HostMatcher ¶
type HostMatcher struct {
// contains filtered or unexported fields
}
HostMatcher is a middleware that matches any host with the given list of hosts. It also supports regex host like *.example.com
func NewHostMatcher ¶
func NewHostMatcher(hosts []string) *HostMatcher
NewHostMatcher creates a new instance of HostMatcher
type Logger ¶
type Logger struct{}
Logger struct contains data and logic required for middleware functionality
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
Stats represents the stats middleware
type StatsTagger ¶
type StatsTagger struct {
// contains filtered or unexported fields
}
StatsTagger is a middleware that takes a list of tags and adds them into context to be propagated
func NewStatsTagger ¶
func NewStatsTagger(tags []tag.Mutator) *StatsTagger
NewStatsTagger creates a new instance of StatsTagger
Click to show internal directories.
Click to hide internal directories.