Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidContentType is returned by ParseRequest if it can't unmarshal it into the passed struct ErrInvalidContentType = errors.New("Invalid request content type") )
Functions ¶
func GetHTTPHost ¶
GetHTTPHost returns the currenthost in the request
func JSONResponse ¶
func JSONResponse(w http.ResponseWriter, status int, data interface{})
JSONResponse writes JSON to an http.ResponseWriter with the corresponding status code
func ParseRequest ¶
ParseRequest takes the input body from the passed request and tries to unmarshal it into data
func RemoteAddr ¶
RemoteAddr extracts the remote address of the request, taking into account proxy headers.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.