holders

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: Unlicense Imports: 11 Imported by: 0

Documentation

Overview

Package holders is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHolderNotFound      = errors.New("no holders found with these filters")
	ErrMultpleHoldersFound = errors.New("multiple holders found with these filters")
)

Functions

This section is empty.

Types

type Holder

type Holder struct {
	ID             uuid.UUID
	Name           string
	DocumentNumber string
}

type HolderFilter

type HolderFilter struct {
	ID             uuid.NullUUID
	Name           string
	DocumentNumber string
	CreatedAtBegin database.NullTime
	CreatedAtEnd   database.NullTime
	UpdatedAtBegin database.NullTime
	UpdatedAtEnd   database.NullTime
}

type HolderModel

type HolderModel struct {
	bun.BaseModel `bun:"table:holders"`

	ID             uuid.UUID `bun:"id,pk"`
	Name           string    `bun:"name"`
	DocumentNumber string    `bun:"document_number"`
	CreatedAt      time.Time `bun:"created_at,notnull"`
	UpdatedAt      time.Time `bun:"updated_at,nullzero"`
}

type ListFilter

type ListFilter struct {
	Sort           int
	Page           int
	Size           int
	DocumentNumber string
}

type MockRepository

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

MockRepository is a mock of Repository interface.

func NewMockRepository

func NewMockRepository(ctrl *gomock.Controller) *MockRepository

NewMockRepository creates a new mock instance.

func (*MockRepository) Create

func (m *MockRepository) Create(ctx context.Context, model HolderModel) (HolderModel, error)

Create mocks base method.

func (*MockRepository) EXPECT

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

func (*MockRepository) GetByFilter

func (m *MockRepository) GetByFilter(ctx context.Context, filter HolderFilter) ([]HolderModel, error)

GetByFilter mocks base method.

func (*MockRepository) ListByFilter

func (m *MockRepository) ListByFilter(ctx context.Context, filter ListFilter) (int, []HolderModel, error)

ListByFilter mocks base method.

func (*MockRepository) Update

func (m *MockRepository) Update(ctx context.Context, model HolderModel) (HolderModel, error)

Update mocks base method.

type MockRepositoryMockRecorder

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

MockRepositoryMockRecorder is the mock recorder for MockRepository.

func (*MockRepositoryMockRecorder) Create

func (mr *MockRepositoryMockRecorder) Create(ctx, model interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockRepositoryMockRecorder) GetByFilter

func (mr *MockRepositoryMockRecorder) GetByFilter(ctx, filter interface{}) *gomock.Call

GetByFilter indicates an expected call of GetByFilter.

func (*MockRepositoryMockRecorder) ListByFilter

func (mr *MockRepositoryMockRecorder) ListByFilter(ctx, filter interface{}) *gomock.Call

ListByFilter indicates an expected call of ListByFilter.

func (*MockRepositoryMockRecorder) Update

func (mr *MockRepositoryMockRecorder) Update(ctx, model interface{}) *gomock.Call

Update indicates an expected call of Update.

type Repository

type Repository interface {
	Create(ctx context.Context, model HolderModel) (HolderModel, error)
	Update(ctx context.Context, model HolderModel) (HolderModel, error)
	GetByFilter(ctx context.Context, filter HolderFilter) ([]HolderModel, error)
	ListByFilter(ctx context.Context, filter ListFilter) (int, []HolderModel, error)
}

func NewRepository

func NewRepository(t tracer.Tracer, db database.Database) Repository

type Service

type Service interface {
	Create(ctx context.Context, holder Holder) (Holder, error)
	Update(ctx context.Context, holder Holder) (Holder, error)
	GetByID(ctx context.Context, id uuid.UUID) (Holder, error)
	List(ctx context.Context, filter ListFilter) (int, []Holder, error)
}

func NewService

func NewService(t tracer.Tracer, r Repository) Service

Jump to

Keyboard shortcuts

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