Documentation
¶
Index ¶
- Constants
- func DebugLoggingMiddleware(requestIDHeaderName string, fields logging.Fields) func(next http.Handler) http.Handler
- func ETag(cksum string) string
- func HeaderTimestamp(ts time.Time) string
- func HostMatches(r *http.Request, hosts []string) bool
- func HostOnly(hostname string) string
- func HostSubdomainOf(r *http.Request, hosts []string) bool
- func HostsOnly(hostname []string) []string
- func LoggingMiddleware(requestIDHeaderName string, fields logging.Fields, traceRequestHeaders bool) func(next http.Handler) http.Handler
- func RequestID(r *http.Request) (*http.Request, string)
- func RequestScheme(r *http.Request) string
- func ServeHealth() http.Handler
- func ServePPROF(pprofPrefix string) http.Handler
- func SetHealthHandlerInfo(info string)
- func TracingMiddleware(requestIDHeaderName string, fields logging.Fields, traceRequestHeaders bool) func(http.Handler) http.Handler
- type CappedBuffer
- type MetricResponseWriter
- type ResponseRecordingWriter
Constants ¶
View Source
const ( MaxBodyBytes = 100 RequestTracingMaxRequestBodySize = 1024 * 1024 * 50 // 50KB RequestTracingMaxResponseBodySize = 1024 * 1024 * 150 // 150KB )
View Source
const (
// Last-Modified: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT
DateHeaderTimestampFormat = "Mon, 02 Jan 2006 15:04:05 GMT"
)
View Source
const (
RequestIDContextKey contextKey = "request_id"
)
Variables ¶
This section is empty.
Functions ¶
func DebugLoggingMiddleware ¶
func HeaderTimestamp ¶
func LoggingMiddleware ¶
func RequestScheme ¶
func ServeHealth ¶
func ServePPROF ¶
func SetHealthHandlerInfo ¶
func SetHealthHandlerInfo(info string)
Types ¶
type CappedBuffer ¶
type MetricResponseWriter ¶
type MetricResponseWriter struct { http.ResponseWriter StatusCode int }
func NewMetricResponseWriter ¶
func NewMetricResponseWriter(w http.ResponseWriter) *MetricResponseWriter
func (*MetricResponseWriter) WriteHeader ¶
func (mrw *MetricResponseWriter) WriteHeader(code int)
type ResponseRecordingWriter ¶
type ResponseRecordingWriter struct { StatusCode int ResponseSize int64 Writer http.ResponseWriter }
func (*ResponseRecordingWriter) Header ¶
func (w *ResponseRecordingWriter) Header() http.Header
func (*ResponseRecordingWriter) Write ¶
func (w *ResponseRecordingWriter) Write(data []byte) (int, error)
func (*ResponseRecordingWriter) WriteHeader ¶
func (w *ResponseRecordingWriter) WriteHeader(statusCode int)
Click to show internal directories.
Click to hide internal directories.