Versions in this module Expand all Collapse all v0 v0.5.0 Oct 8, 2019 Changes in this version + func BadGatewayResponse(writer http.ResponseWriter, message string) + func BadRequestResponse(writer http.ResponseWriter, message string) + func ConflictResponse(writer http.ResponseWriter, message string) + func ErrorResponse(w http.ResponseWriter, e IError) + func ExpectationFailedResponse(writer http.ResponseWriter, message string) + func FailedDependencyResponse(writer http.ResponseWriter, message string) + func ForbiddenResponse(writer http.ResponseWriter, message string) + func GatewayTimeoutResponse(writer http.ResponseWriter, message string) + func GoneResponse(writer http.ResponseWriter, message string) + func HTTPVersionNotSupportedResponse(writer http.ResponseWriter, message string) + func InsufficientStorageResponse(writer http.ResponseWriter, message string) + func InternalServerErrorResponse(writer http.ResponseWriter, message string) + func LengthRequiredResponse(writer http.ResponseWriter, message string) + func LockedResponse(writer http.ResponseWriter, message string) + func LoopDetectedResponse(writer http.ResponseWriter, message string) + func MethodNotAllowedResponse(writer http.ResponseWriter, message string) + func MisdirectedRequestResponse(writer http.ResponseWriter, message string) + func NetworkAuthenticationRequiredResponse(writer http.ResponseWriter, message string) + func NotAcceptableResponse(writer http.ResponseWriter, message string) + func NotExtendedResponse(writer http.ResponseWriter, message string) + func NotFoundResponse(writer http.ResponseWriter, message string) + func NotImplementedResponse(writer http.ResponseWriter, message string) + func OkResponse(writer http.ResponseWriter, message string, data interface{}, meta interface{}) + func PaymentRequiredResponse(writer http.ResponseWriter, message string) + func PreconditionFailedResponse(writer http.ResponseWriter, message string) + func PreconditionRequiredResponse(writer http.ResponseWriter, message string) + func ProxyAuthRequiredResponse(writer http.ResponseWriter, message string) + func RequestEntityTooLargeResponse(writer http.ResponseWriter, message string) + func RequestHeaderFieldsTooLargeResponse(writer http.ResponseWriter, message string) + func RequestTimeoutResponse(writer http.ResponseWriter, message string) + func RequestURITooLongResponse(writer http.ResponseWriter, message string) + func RequestedRangeNotSatisfiableResponse(writer http.ResponseWriter, message string) + func SendJson(writer http.ResponseWriter, httpCode int, data interface{}) + func ServiceUnavailableResponse(writer http.ResponseWriter, message string) + func TeapotResponse(writer http.ResponseWriter, message string) + func TooEarlyResponse(writer http.ResponseWriter, message string) + func TooManyRequestsResponse(writer http.ResponseWriter, message string) + func UnauthorizedResponse(writer http.ResponseWriter, message string) + func UnavailableForLegalReasonsResponse(writer http.ResponseWriter, message string) + func UnprocessableEntityResponse(writer http.ResponseWriter, message string) + func UnsupportedMediaTypeResponse(writer http.ResponseWriter, message string) + func UpgradeRequiredResponse(writer http.ResponseWriter, message string) + func VariantAlsoNegotiatesResponse(writer http.ResponseWriter, message string) + type Error struct + Code *int + Errors *ErrorDetails + Message string + func (e *Error) AppendDetail(message string, key *string, code *int) IError + func (e *Error) Error() string + func (e *Error) GetCode() *int + func (e *Error) GetDetails() *ErrorDetails + func (e *Error) GetHttpCode() int + func (e *Error) SetCode(code *int) IError + func (e *Error) SetDetails(details *ErrorDetails) IError + type ErrorDetails []ErrorField + type ErrorField struct + Code *int + Key *string + Message string + type IError interface + AppendDetail func(message string, key *string, code *int) IError + Error func() string + GetCode func() *int + GetDetails func() *ErrorDetails + GetHttpCode func() int + SetCode func(code *int) IError + SetDetails func(details *ErrorDetails) IError + func NewRestError(message string, httpCode int) IError + func ReadJsonBody(r *http.Request, data interface{}) (interface{}, IError) + type JsonDetailError struct + Code string + Message string + Name string + type JsonError struct + Code string + Data []JsonDetailError + Message string + func (e *JsonError) FlushDetail() *JsonError + func (e *JsonError) PopDetail() *JsonDetailError + func (e *JsonError) PushDetail(name string, code string, message string) *JsonError + type JsonResponse struct + Data interface{} + Debug interface{} + Error *JsonError + Meta interface{} + func NewErrorJsonResponse(debug interface{}, message, code string) *JsonResponse + func NewOkJsonResponse(debug interface{}, data interface{}, meta interface{}) *JsonResponse + type Meta struct + Limit int + Page int + Total int + type Response struct + Code *int + Data interface{} + Errors interface{} + Message string + Meta interface{} + func NewResponse(writer http.ResponseWriter, code int) *Response + func (response *Response) Send()