Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONResponse ¶
JSONResponse middleware is used to inject response object in context and later render it as JSON.
Types ¶
type Response ¶
type Response struct { Payload interface{} `json:"data,omitempty"` Errors []string `json:"errors,omitempty"` // contains filtered or unexported fields }
Response ...
func ResponseFromContext ¶
ResponseFromContext returns response from context.
func (*Response) SetHeaders ¶
SetHeaders sets headers to response.
func (*Response) SetPayload ¶
SetPayload sets payload to response.
func (*Response) SetStatusCode ¶
SetStatusCode sets status code to response. If status code is not set if will default to http.StatusOK.
Click to show internal directories.
Click to hide internal directories.