Documentation
¶
Index ¶
- Variables
- type JSONErrorResponse
- type JSONValidationErrorResponse
- type Response
- func NewDebugErrorResponse(err error, debugErr error) *Response
- func NewDebugErrorResponseWithCode(err error, debugErr error, code int) *Response
- func NewDebugResponse(data interface{}, debugData interface{}) *Response
- func NewDebugResponseWithCode(data interface{}, debugData interface{}, code int) *Response
- func NewErrorResponse(err error) *Response
- func NewErrorResponseWithCode(err error, code int) *Response
- func NewResponse(data interface{}) *Response
- func NewResponseWithCode(data interface{}, code int) *Response
Constants ¶
This section is empty.
Variables ¶
var ( ErrNilResponse = errors.New("response cannot be nil") ErrNilResponseCode = errors.New("response code cannot be nil") )
var (
InternalServerError = NewJSONErrorResponseFromString(gonethttp.InternalServerError)
)
Functions ¶
This section is empty.
Types ¶
type JSONErrorResponse ¶ added in v0.3.0
type JSONErrorResponse struct {
Error string `json:"error"`
}
JSONErrorResponse struct
func NewJSONErrorResponse ¶ added in v0.3.0
func NewJSONErrorResponse(err error) *JSONErrorResponse
NewJSONErrorResponse creates a new error response
func NewJSONErrorResponseFromString ¶ added in v0.4.10
func NewJSONErrorResponseFromString(err string) *JSONErrorResponse
NewJSONErrorResponseFromString creates a new error response from a string
type JSONValidationErrorResponse ¶ added in v0.4.13
type JSONValidationErrorResponse struct {
Message string `json:"message"`
Error interface{} `json:"error"`
}
JSONValidationErrorResponse struct
func NewJSONValidationErrorResponse ¶ added in v0.4.13
func NewJSONValidationErrorResponse(
err interface{},
message string,
) *JSONValidationErrorResponse
NewJSONValidationErrorResponse creates a new validation error response
type Response ¶ added in v0.3.0
type Response struct {
Data interface{}
DebugData interface{}
Code *int
}
Response struct
func NewDebugErrorResponse ¶ added in v0.4.6
NewDebugErrorResponse creates a new error response
func NewDebugErrorResponseWithCode ¶ added in v0.4.6
NewDebugErrorResponseWithCode creates a new error response with a code
func NewDebugResponse ¶ added in v0.4.6
func NewDebugResponse(data interface{}, debugData interface{}) *Response
NewDebugResponse creates a new response
func NewDebugResponseWithCode ¶ added in v0.4.6
NewDebugResponseWithCode creates a new response with a code
func NewErrorResponse ¶
NewErrorResponse creates a new error response
func NewErrorResponseWithCode ¶ added in v0.3.0
NewErrorResponseWithCode creates a new error response with a code
func NewResponse ¶ added in v0.3.0
func NewResponse(data interface{}) *Response
NewResponse creates a new response
func NewResponseWithCode ¶ added in v0.3.0
NewResponseWithCode creates a new response with a code