Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ApplicationErrorForbidden = ApplicationError{HTTPStatusCode: 403, ErrorCode: "FORBIDDEN", ErrorText: "forbidden"} ApplicationErrorInvalidInput = ApplicationError{HTTPStatusCode: 400, ErrorCode: "INVALID_INPUT", ErrorText: "invalid input"} ApplicationErrorInternalServerError = ApplicationError{HTTPStatusCode: 500, ErrorCode: "INTERNAL_SERVER_ERROR", ErrorText: "unknown error"} )
Functions ¶
This section is empty.
Types ¶
type ApplicationError ¶
type ApplicationError struct {
HTTPStatusCode int `json:"statusCode,omitempty"`
ErrorCode string `json:"code,omitempty"`
ErrorText string `json:"message,omitempty"`
}
func ApplicationErrorFromJson ¶
func ApplicationErrorFromJson(body []byte, status int) ApplicationError
func NewApplicationError ¶
func NewApplicationError(httpStatusCode int, errorCode, errorText string) ApplicationError
func (ApplicationError) CustomMessage ¶
func (err ApplicationError) CustomMessage(message string) ApplicationError
func (ApplicationError) Error ¶
func (err ApplicationError) Error() string
type RequestContext ¶
func NewRequestContext ¶
func NewRequestContext(ctx context.Context) RequestContext
func (*RequestContext) WithLogger ¶
func (r *RequestContext) WithLogger(logger zerolog.Logger)
Click to show internal directories.
Click to hide internal directories.