Documentation
¶
Overview ¶
Package rkerror defines RK style API errors.
Index ¶
- type Error
- type ErrorResp
- func FromError(err error) *ErrorResp
- func New(code int, msg string, details ...interface{}) *ErrorResp
- func NewBadRequest(msg string, details ...interface{}) *ErrorResp
- func NewForbidden(msg string, details ...interface{}) *ErrorResp
- func NewInternalError(msg string, details ...interface{}) *ErrorResp
- func NewTimeout(msg string, details ...interface{}) *ErrorResp
- func NewTooManyRequests(msg string, details ...interface{}) *ErrorResp
- func NewUnauthorized(msg string, details ...interface{}) *ErrorResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct { Code int `json:"code" yaml:"code"` // Code represent codes in response Status string `json:"status" yaml:"status"` // Status represent string value of code Message string `json:"message" yaml:"message"` // Message represent detail message Details []interface{} `json:"details" yaml:"details"` // Details is a list of details in any types in string }
Error defines standard error types of rk style
type ErrorResp ¶
type ErrorResp struct {
Err *Error `json:"error" yaml:"error"` // Err is RK style error type
}
ErrorResp is standard rk style error
func NewBadRequest ¶
func NewForbidden ¶
func NewInternalError ¶
func NewTimeout ¶
func NewTooManyRequests ¶
func NewUnauthorized ¶
Click to show internal directories.
Click to hide internal directories.