Documentation
¶
Index ¶
Constants ¶
View Source
const ( MsgInternalServer = "An internal error has occurred" MsgInvalidRequest = "An invalid request was provided" MsgResourceNotFound = "The resource cannot be found" MsgRouteNotFound = "The route cannot be found" MsgMethodNotAllowed = "The method is not allowed" MsgInvalidValue = "Invalid value" MsgUnknownField = "Unknown field" )
Variables ¶
Functions ¶
Types ¶
type Response ¶
type Response struct {
// Shared common fields.
Code int `json:"-"`
Headers map[string]string `json:"-"`
Action string `json:"action,omitempty"`
// Success specific fields.
Data interface{} `json:"data,omitempty"`
Meta interface{} `json:"meta,omitempty"`
// Failure specific fields.
Message string `json:"message,omitempty"`
Errors map[string]string `json:"errors,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.