rest

package
v0.0.0-...-3eb0fa6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package rest is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBadRequest

func NewBadRequest(message string) error

NewBadRequest - BadRequestを生成して返す

func NewConflict

func NewConflict(message string) error

NewConflict - Conflictを生成して返す

func NewForbidden

func NewForbidden(message string) error

NewForbidden - Forbiddenを生成して返す

func NewInternalServerError

func NewInternalServerError(message string) error

NewInternalServerError - InternalServerErrorを生成して返す

func NewNotFound

func NewNotFound(message string) error

NewNotFound - NotFoundを生成して返す

func NewUnauthorized

func NewUnauthorized(message string) error

NewUnauthorized - Unauthorizedを生成して返す

func RespondMessage

func RespondMessage(ctx echo.Context, err error) error

RespondMessage - ステータスコードに紐づけられたエラーであればechoのresponseを返す

func RespondOK

func RespondOK(ctx echo.Context, json map[string]interface{}) error

RespondOK - 正常終了した際の結果を返す

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) Error

func (e Conflict) Error() string

func (Conflict) RespondError

func (e Conflict) RespondError(ctx echo.Context) error

type ErrorResponse

type ErrorResponse interface {
	RespondError(e echo.Context) error

	error
}

ErrorResponse - エラーメッセージをJSONとして返却するインターフェース

type Forbidden

type Forbidden struct {
	// contains filtered or unexported fields
}

Forbidden - ユーザが認証されていない時に返す

func (Forbidden) Error

func (e Forbidden) Error() string

func (Forbidden) RespondError

func (e Forbidden) RespondError(ctx echo.Context) error

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

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

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) Error

func (e NotFound) Error() string

func (NotFound) RespondError

func (e NotFound) RespondError(ctx echo.Context) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL