Documentation ¶
Index ¶
- Variables
- func GetCustomerID(w http.ResponseWriter, r *http.Request) string
- func GetOrganization(w http.ResponseWriter, r *http.Request) string
- func GetRequestID(r *http.Request) string
- func Responder(logger log.Logger, w http.ResponseWriter, r *http.Request) http.ResponseWriter
- func SetAccessControlAllowHeaders(w http.ResponseWriter, origin string)
- type ResponseWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoCustomerID = errors.New("no Customer ID found")
)
Functions ¶
func GetCustomerID ¶
func GetCustomerID(w http.ResponseWriter, r *http.Request) string
func GetOrganization ¶
func GetOrganization(w http.ResponseWriter, r *http.Request) string
GetOrganization returns the value from the X-Organization header and writes an error to w if it's missing
func GetRequestID ¶
GetRequestID returns the Moov header value for request IDs
func Responder ¶
func Responder(logger log.Logger, w http.ResponseWriter, r *http.Request) http.ResponseWriter
func SetAccessControlAllowHeaders ¶
func SetAccessControlAllowHeaders(w http.ResponseWriter, origin string)
SetAccessControlAllowHeaders writes Access-Control-Allow-* headers to a response to allow for further CORS-allowed requests.
Types ¶
type ResponseWriter ¶
type ResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
ResponseWriter implements Go's standard library http.ResponseWriter to complete HTTP requests
func Wrap ¶
func Wrap(logger log.Logger, m metrics.Histogram, w http.ResponseWriter, r *http.Request) *ResponseWriter
Wrap returns a ResponseWriter usable by applications. No parts of the Request are inspected or ResponseWriter modified.
func (*ResponseWriter) WriteHeader ¶
func (w *ResponseWriter) WriteHeader(code int)
WriteHeader sends an HTTP response header with the provided status code, records response duration, and optionally records the HTTP metadata in a go-kit log.Logger
Click to show internal directories.
Click to hide internal directories.