writer

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchRoutePathTemplate

func FetchRoutePathTemplate(r *http.Request) string

FetchRoutePathTemplate extracts the path template from a given request, or emptry string if none could be found.

Types

type StatusRecorder

type StatusRecorder struct {
	http.ResponseWriter
	StatusCode int
}

StatusRecorder wraps the http ResponseWriter, allowing additional instrumentation and metrics capture before the response is returned to the client.

func (*StatusRecorder) WriteHeader

func (sr *StatusRecorder) WriteHeader(code int)

WriteHeader implements the http ResponseWriter WriteHeader interface. This function acts as a middleware which captures the StatusCode on the StatusRecorder and then delegates the actual work of writing the header to the underlying http ResponseWriter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL