Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefaultResponseInterceptor ¶
func SetDefaultResponseInterceptor(r Recorder)
SetDefaultResponseInterceptor for http handler response
Types ¶
type Middleware ¶
type Middleware func(http.HandlerFunc) http.HandlerFunc
Middleware is a chainable preprocessor for Endpoint
func Chain ¶
func Chain(first Middleware, others ...Middleware) Middleware
Chain is a helper function for composing middlewares.
func RecoverWithTrace ¶
func RecoverWithTrace(name string) Middleware
RecoverWithTrace middleware is a RecoverMiddleware wraps with a trace handler
func (Middleware) HandlerFunc ¶
func (m Middleware) HandlerFunc(next http.HandlerFunc) http.HandlerFunc
HandlerFunc will return the HandlerFunc of the middleware
type Recorder ¶
type Recorder interface {
Record(ctx context.Context, statistics Statistics)
}
Recorder for http handler response status & body size
func NewMultiRecorder ¶
NewMultiRecorder will chain MultiRecorder
type Statistics ¶
Statistics for http handler response
Click to show internal directories.
Click to hide internal directories.