You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
866 B
21 lines
866 B
// JSend is a package to make standardizing API responses easy
|
|
// It is based on the jsend specification that can be found at:
|
|
// https://github.com/omniti-labs/jsend
|
|
package jsend
|
|
|
|
type response struct {
|
|
// Required. Either "success" for a successful request, "fail"
|
|
// for a failed request, or "error" for a server error.
|
|
Status string `json:"status"`
|
|
// Required for "success" and "fail". Data is a wrapper for
|
|
// any information the API returns.
|
|
// If the reasons for failure correspond to POST values,
|
|
// the response object's keys SHOULD correspond to those POST values.
|
|
Data map[string]interface{} `json:"data,omitempty"`
|
|
// Required for "error". A meaningful, end-user-readable
|
|
// message, explaining what went wrong.
|
|
Message string `json:"message,omitempty"`
|
|
// Optional for "error". A numerical error code.
|
|
Code int `json:"code,omitempty"`
|
|
}
|