Documentation
¶
Overview ¶
Package core implements some core functions used by apimachinery.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteResponse ¶
WriteResponse write an error or the response data into http response body. It use errors-base-sdk.ParseCoder to parse any error into errors-base-sdk.Coder errors-base-sdk.Coder contains error code, user-safe error message and http status code.
Types ¶
type ErrResponse ¶
type ErrResponse struct { // Code defines the business error code. Code int `json:"code"` // Message contains the detail of this message. // This message is suitable to be exposed to external Message string `json:"message"` // Reference returns the reference document which maybe useful to solve this error. Reference string `json:"reference,omitempty"` }
ErrResponse defines the return messages when an error occurred. Reference will be omitted if it does not exist. swagger:model
Click to show internal directories.
Click to hide internal directories.