Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteError ¶
func WriteError(err error, w http.ResponseWriter)
WriteError converts an error to an JSON error response. If it is known internal error of type server.Error then it sets the messages from the error, a generic message otherwise
func WriteErrorResponse ¶
func WriteErrorResponse(errMsg string, httpStatus int, w http.ResponseWriter)
WriteErrorResponse prepares and writes an error response i nJSON
func WriteJSONObject ¶
func WriteJSONObject(w http.ResponseWriter, obj interface{})
WriteJSONObject simply writes object to the HTTP reponse in JSON format
Types ¶
type Duration ¶
Duration is used strictly for JSON requests/responses due to duration marshalling issues
func (Duration) MarshalJSON ¶
MarshalJSON marshals the duration
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON unmarshals the duration
Click to show internal directories.
Click to hide internal directories.