route

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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

func GetRequestID(r *http.Request) string

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

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

Jump to

Keyboard shortcuts

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