Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstQueryVals ¶
FirstQueryVals takes a url and returns a map taking only the first value of each query param sent
func WrapHandler ¶
func WrapHandler(f interface{}, methods ...string) func(ResponseWriter, *Request)
wrapHandler takes a handler function and for each request, it rejects unaccepted methods, converts the query args to the function's args pointer and then validates those args.
If the method returns a non-nil error, then the error is returned if its an instance of PublicError, otherwise a generic "Internal Error" is sent back to the client. If a status code of 0 is returned, then if error is nil, a 500 is sent and otherwise a 200 is sent.
Types ¶
Click to show internal directories.
Click to hide internal directories.