apierr

package
v0.0.0-...-2741532 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package apierr is a generated GoMock package.

Index

Constants

View Source
const InternalServerError = "Internal server error"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct{}

Client is the APIERROR client

func New

func New() *Client

New return new client of api errors

func (Client) BadRequest

func (c Client) BadRequest(message string, err error) *Message

BadRequest return new response in correct structure

func (Client) Blocked

func (c Client) Blocked() *Message

func (Client) InternalServerError

func (c Client) InternalServerError(err error) *Message

InternalServerError return internal server error default

func (Client) NotFounded

func (c Client) NotFounded(err error) *Message

func (Client) Unauthorized

func (c Client) Unauthorized(message string) *Message

Unauthorized return unauthorized error error default

type Message

type Message struct {
	ErrorMessage string `json:"message"`
	ErrorCode    string `json:"error"`
	ErrorStatus  int    `json:"status"`
	Error        error  `json:"-"`
}

Message of response errors

type MockProvider

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

MockProvider is a mock of Provider interface.

func NewMockProvider

func NewMockProvider(ctrl *gomock.Controller) *MockProvider

NewMockProvider creates a new mock instance.

func (*MockProvider) BadRequest

func (m *MockProvider) BadRequest(message string, err error) *Message

BadRequest mocks base method.

func (*MockProvider) Blocked

func (m *MockProvider) Blocked() *Message

Blocked mocks base method.

func (*MockProvider) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockProvider) InternalServerError

func (m *MockProvider) InternalServerError(err error) *Message

InternalServerError mocks base method.

func (*MockProvider) NotFounded

func (m *MockProvider) NotFounded(err error) *Message

NotFound mocks base method.

func (*MockProvider) Unauthorized

func (m *MockProvider) Unauthorized(message string) *Message

Unauthorized mocks base method.

type MockProviderMockRecorder

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

MockProviderMockRecorder is the mock recorder for MockProvider.

func (*MockProviderMockRecorder) BadRequest

func (mr *MockProviderMockRecorder) BadRequest(message, err interface{}) *gomock.Call

BadRequest indicates an expected call of BadRequest.

func (*MockProviderMockRecorder) Blocked

func (mr *MockProviderMockRecorder) Blocked() *gomock.Call

Blocked indicates an expected call of Blocked.

func (*MockProviderMockRecorder) InternalServerError

func (mr *MockProviderMockRecorder) InternalServerError(err interface{}) *gomock.Call

InternalServerError indicates an expected call of InternalServerError.

func (*MockProviderMockRecorder) NotFound

func (mr *MockProviderMockRecorder) NotFound(err interface{}) *gomock.Call

NotFound indicates an expected call of NotFound.

func (*MockProviderMockRecorder) Unauthorized

func (mr *MockProviderMockRecorder) Unauthorized(message interface{}) *gomock.Call

Unauthorized indicates an expected call of Unauthorized.

type Provider

type Provider interface {
	BadRequest(message string, err error) *Message
	InternalServerError(err error) *Message
	Unauthorized(message string) *Message
	Blocked() *Message
	NotFounded(err error) *Message
}

Jump to

Keyboard shortcuts

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