Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = &Error{Text: "Resource could not be found"} ErrMethodNotAllowed = &Error{Text: "Method not supported by the resource"} ErrParse = &Error{Text: "Unable to process the request due to invalid syntax"} ErrValidation = &Error{Text: "Unable to process the request due to invalid data"} ErrInternal = &Error{Text: "The server encountered an unexpected condition"} )
Functions ¶
func Gob ¶
func Gob(w http.ResponseWriter, v interface{}, code int)
func JSON ¶
func JSON(w http.ResponseWriter, v interface{}, code int)
Types ¶
type Response ¶
type Response struct { Status string `json:"status"` Data interface{} `json:"data,omitempty"` Error string `json:"error,omitempty"` Details interface{} `json:"details,omitempty"` // contains filtered or unexported fields }
func NewResponse ¶
func NewResponse(w http.ResponseWriter) *Response
func (*Response) SetStatusCode ¶
Click to show internal directories.
Click to hide internal directories.