Documentation ¶
Overview ¶
Package ctxhandler implements context handler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextAdapter ¶
type ContextAdapter struct { Logger *zap.Logger Ctx context.Context Handler ContextHandler }
ContextAdapter wraps context handler.
func (*ContextAdapter) ServeHTTP ¶
func (ca *ContextAdapter) ServeHTTP(w http.ResponseWriter, req *http.Request)
type ContextHandler ¶
type ContextHandler interface {
ServeHTTPContext(context.Context, http.ResponseWriter, *http.Request) error
}
ContextHandler handles ServeHTTP with context.
type ContextHandlerFunc ¶
ContextHandlerFunc defines HandlerFunc function signature to wrap context.
func (ContextHandlerFunc) ServeHTTPContext ¶
func (f ContextHandlerFunc) ServeHTTPContext(ctx context.Context, w http.ResponseWriter, req *http.Request) error
ServeHTTPContext serve HTTP requests with context.
Click to show internal directories.
Click to hide internal directories.