Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorMessage ¶ added in v0.0.34
type ErrorMessage string
const ( ErrMgsInternalError ErrorMessage = "An internal error has occurred" ErrMgsInvalidRequest ErrorMessage = "An invalid request was provided" ErrMgsResourceNotFound ErrorMessage = "The resource cannot be found" ErrMgsRouteNotFound ErrorMessage = "The route cannot be found" ErrMgsMethodNotAllowed ErrorMessage = "The method is not allowed" )
type Response ¶ added in v0.0.16
type Response struct {
// Shared common fields.
Status int `json:"-"`
Headers map[string]string `json:"-"`
Operation string `json:"operation,omitempty"`
// Success specific fields.
Data interface{} `json:"data,omitempty"`
Meta interface{} `json:"meta,omitempty"`
// Failure specific fields.
Code ErrorCode `json:"code,omitempty"`
Message ErrorMessage `json:"message,omitempty"`
Errors map[string]string `json:"errors,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.