Documentation
¶
Overview ¶
Package rkerror defines RK style API errors.
Index ¶
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
type Option ¶
type Option func(*ErrorResp)
Option is ErrorResp option
func WithDetails ¶
func WithDetails(details ...interface{}) Option
WithDetails provides any type of error details into error response
func WithMessage ¶
WithMessage provides messages along with response
Click to show internal directories.
Click to hide internal directories.