Documentation
¶
Overview ¶
Package rest is a generated GoMock package.
Index ¶
- func NewBadRequest(message string) error
- func NewConflict(message string) error
- func NewForbidden(message string) error
- func NewInternalServerError(message string) error
- func NewNotFound(message string) error
- func NewUnauthorized(message string) error
- func RespondMessage(ctx echo.Context, err error) error
- func RespondOK(ctx echo.Context, json map[string]interface{}) error
- func RespondOKAny(ctx echo.Context, j interface{}) error
- type BadRequest
- type Conflict
- type ErrorResponse
- type Forbidden
- type InternalServerError
- type MockErrorResponse
- type MockErrorResponseMockRecorder
- type NotFound
- type Unauthorized
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInternalServerError ¶
NewInternalServerError - InternalServerErrorを生成して返す
func NewUnauthorized ¶
NewUnauthorized - Unauthorizedを生成して返す
func RespondMessage ¶
RespondMessage - ステータスコードに紐づけられたエラーであればechoのresponseを返す
func RespondOKAny ¶
func RespondOKAny(ctx echo.Context, j interface{}) error
RespondOKAny - 正常終了した際の結果を返す(struct用)
Types ¶
type BadRequest ¶
type BadRequest struct {
// contains filtered or unexported fields
}
BadRequest - ユーザの入力値が不正だった場合に返す
func (BadRequest) Error ¶
func (e BadRequest) Error() string
func (BadRequest) RespondError ¶
func (e BadRequest) RespondError(ctx echo.Context) error
type Conflict ¶
type Conflict struct {
// contains filtered or unexported fields
}
Conflict - リソースが既に存在した場合に返す
func (Conflict) RespondError ¶
type ErrorResponse ¶
ErrorResponse - エラーメッセージをJSONとして返却するインターフェース
type Forbidden ¶
type Forbidden struct {
// contains filtered or unexported fields
}
Forbidden - ユーザが認証されていない時に返す
func (Forbidden) RespondError ¶
type InternalServerError ¶
type InternalServerError struct {
// contains filtered or unexported fields
}
InternalServerError - サーバ内部でエラーが発生
func (InternalServerError) Error ¶
func (e InternalServerError) Error() string
func (InternalServerError) RespondError ¶
func (e InternalServerError) RespondError(ctx echo.Context) error
type MockErrorResponse ¶
type MockErrorResponse struct {
// contains filtered or unexported fields
}
MockErrorResponse is a mock of ErrorResponse interface.
func NewMockErrorResponse ¶
func NewMockErrorResponse(ctrl *gomock.Controller) *MockErrorResponse
NewMockErrorResponse creates a new mock instance.
func (*MockErrorResponse) EXPECT ¶
func (m *MockErrorResponse) EXPECT() *MockErrorResponseMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockErrorResponse) Error ¶
func (m *MockErrorResponse) Error() string
Error mocks base method.
func (*MockErrorResponse) RespondError ¶
func (m *MockErrorResponse) RespondError(e echo.Context) error
RespondError mocks base method.
type MockErrorResponseMockRecorder ¶
type MockErrorResponseMockRecorder struct {
// contains filtered or unexported fields
}
MockErrorResponseMockRecorder is the mock recorder for MockErrorResponse.
func (*MockErrorResponseMockRecorder) Error ¶
func (mr *MockErrorResponseMockRecorder) Error() *gomock.Call
Error indicates an expected call of Error.
func (*MockErrorResponseMockRecorder) RespondError ¶
func (mr *MockErrorResponseMockRecorder) RespondError(e interface{}) *gomock.Call
RespondError indicates an expected call of RespondError.
type NotFound ¶
type NotFound struct {
// contains filtered or unexported fields
}
NotFound - ユーザの入力値が不正だった場合に返す
func (NotFound) RespondError ¶
type Unauthorized ¶
type Unauthorized struct {
// contains filtered or unexported fields
}
Unauthorized - ユーザが認証されていない時に返す
func (Unauthorized) Error ¶
func (e Unauthorized) Error() string
func (Unauthorized) RespondError ¶
func (e Unauthorized) RespondError(ctx echo.Context) error