Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrParsingFailed was occurred when request invalid syntax. ErrParsingFailed = errors.New("parsing is failed by invalid syntax") // ErrEntityNotFound was occurred when can't found entity. ErrEntityNotFound = errors.New("Entity was not found") // ErrAlreadyExistsEntity was occurred // when insert data that contain duplicated key. ErrAlreadyExistsEntity = errors.New("Already exists entity") // ErrInvalidUUID was occurred when uuid format was invalid. ErrInvalidUUID = errors.New("UUID was invalid") // ErrInvalidRequestPayload is occurred when payload is invalid. ErrInvalidRequestPayload = errors.New("Request payload is invalid") )
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct {
Message string `json:"message"`
}
APIError is http error object.
type Controller ¶
type Controller struct{}
Controller is common controller.
func (Controller) RegisterRoutes ¶
func (c Controller) RegisterRoutes(router gin.IRouter)
RegisterRoutes is method that register api routes.
type ErrorResponse ¶
type ErrorResponse struct {
Errors []APIError `json:"errors"`
}
ErrorResponse is app response.
func (ErrorResponse) AddError ¶
func (errResponse ErrorResponse) AddError(err error) ErrorResponse
AddError add new error at ErrorResponse.
Click to show internal directories.
Click to hide internal directories.