Documentation ¶
Index ¶
- Constants
- func NewHTTPRouter(routes []*Route) (*httprouter.Router, error)
- func NewLoggingHTTPRouter(routes []*Route, loggingHeaders []string, logWriter io.Writer) (http.Handler, error)
- func RegisterRoutes(r *httprouter.Router, loggerContextKey interface{}, routes []*Route) error
- type AccessLogDecorator
- type AccessLogRow
- type AccessLogRowFiller
- type AccessLogRowFillerFactory
- type FormattedResponse
- type MethodLogger
- type Route
- type ServiceHandler
- type ServiceMethodContext
Constants ¶
View Source
const ServiceHandlerAccessLogRowFillerContextKey = "apihttpwrapper.ServiceHandlerAccessLogRowFiller"
Variables ¶
This section is empty.
Functions ¶
func NewHTTPRouter ¶
func NewHTTPRouter(routes []*Route) (*httprouter.Router, error)
func NewLoggingHTTPRouter ¶
func RegisterRoutes ¶
func RegisterRoutes(r *httprouter.Router, loggerContextKey interface{}, routes []*Route) error
Types ¶
type AccessLogDecorator ¶
func NewAccessLogDecorator ¶
func NewAccessLogDecorator(handler http.Handler, logWriter io.Writer, loggingHeaders []string, rowFillerContextKey interface{}, rowFillerFactory AccessLogRowFillerFactory) *AccessLogDecorator
func (*AccessLogDecorator) ServeHTTP ¶
func (d *AccessLogDecorator) ServeHTTP(w http.ResponseWriter, r *http.Request)
type AccessLogRow ¶
type AccessLogRow struct {
// contains filtered or unexported fields
}
func (*AccessLogRow) SetRowField ¶
func (row *AccessLogRow) SetRowField(field string, value string)
type AccessLogRowFiller ¶
type AccessLogRowFiller interface{}
func ServiceHandlerAccessLogRowFillerFactory ¶
func ServiceHandlerAccessLogRowFillerFactory(row *AccessLogRow) AccessLogRowFiller
type AccessLogRowFillerFactory ¶
type AccessLogRowFillerFactory func(*AccessLogRow) AccessLogRowFiller
type FormattedResponse ¶
type MethodLogger ¶
type ServiceHandler ¶
type ServiceHandler struct {
// contains filtered or unexported fields
}
func NewServiceHandler ¶
func NewServiceHandler(method interface{}, loggerContextKey interface{}, bypassRequestBody bool) (h *ServiceHandler, err error)
func (*ServiceHandler) ServeHTTP ¶
func (h *ServiceHandler) ServeHTTP(respWriter http.ResponseWriter, req *http.Request)
func (*ServiceHandler) ServeHTTPWithParams ¶
func (h *ServiceHandler) ServeHTTPWithParams(rw http.ResponseWriter, r *http.Request, params httprouter.Params)
Click to show internal directories.
Click to hide internal directories.