Documentation ¶
Index ¶
- func CSV(w http.ResponseWriter, data string) *errors.AppError
- func Created(w http.ResponseWriter, data interface{}) *errors.AppError
- func Fail(w http.ResponseWriter, e *errors.AppError) *errors.AppError
- func Msg(msg interface{}) map[string]interface{}
- func NoContent(w http.ResponseWriter, data interface{}) *errors.AppError
- func OK(w http.ResponseWriter, data interface{}) *errors.AppError
- type Meta
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CSV ¶
func CSV(w http.ResponseWriter, data string) *errors.AppError
CSV writes the text/csv response into the responsewriter
func Created ¶
func Created(w http.ResponseWriter, data interface{}) *errors.AppError
Created is a helper function used to send response data with StatusCreated status code (201) NOTE: HTTP Method POST which creates any resource on the server should use status code (201)
Types ¶
type Meta ¶
type Meta struct {
Status int `json:"status_code"`
}
Meta holds the status of the request informations TODO: add meta information for paginations
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response struct contains all the fields needed to respond to a particular request NOTE: we may add support for Metadata interface{}
func NewResponse ¶
NewResponse returns a new response object.
Click to show internal directories.
Click to hide internal directories.