Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InvalidRequest ¶
func InvalidRequest( w http.ResponseWriter, r *http.Request, err error, message string, httpCode int, )
InvalidRequest handles API errors.
func ToJSON ¶
func ToJSON( w http.ResponseWriter, httpCode int, dest interface{}, )
ToJSON returns a JSON response.
Types ¶
type APIMessage ¶
type APIMessage struct { Message string `json:"message,omitempty"` Status int `json:"status,omitempty"` }
APIMessage is a struct for generic JSON response.
Click to show internal directories.
Click to hide internal directories.