Versions in this module Expand all Collapse all v1 v1.0.0 Jul 8, 2023 Changes in this version + var BadRequest = New(CodeBadRequest, http.StatusText(http.StatusBadRequest)) + var Forbidden = New(CodeForbidden, http.StatusText(http.StatusForbidden)) + var Gone = New(CodeGone, http.StatusText(http.StatusGone)) + var InternalServerError = New(CodeInternalServerError, http.StatusText(http.StatusInternalServerError)) + var NotFound = New(CodeNotFound, http.StatusText(http.StatusNotFound)) + var NotImplemented = New(CodeNotImplemented, http.StatusText(http.StatusNotImplemented)) + var ServiceUnavailable = New(CodeServiceUnavailable, http.StatusText(http.StatusServiceUnavailable)) + var TooManyRequest = New(CodeTooManyRequests, http.StatusText(http.StatusTooManyRequests)) + var Unauthorized = New(CodeUnauthorized, http.StatusText(http.StatusUnauthorized)) + func ResponseError(c *gin.Context, err error) + type Code string + const CodeBadRequest + const CodeForbidden + const CodeGone + const CodeInternalServerError + const CodeNotFound + const CodeNotImplemented + const CodeServiceUnavailable + const CodeTooManyRequests + const CodeUnauthorized + func (c Code) String() string + type Error struct + Code Code + Info map[string]interface{} + Message string + Timestamp time.Time + func InvalidStructError(err error) *Error + func New(code Code, msg string, opts ...Option) *Error + func (e *Error) Error() string + func (e *Error) HTTPStatusCode() int + type Option func(*option) + func WithInfo(info map[string]interface{}) Option + func WithLogErr(err error) Option