repository

package
v0.0.0-...-1c756da Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package repository is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookDetails

type BookDetails struct {
	ID     string
	Title  string
	Author string
	Pages  int
}

type BooksFilter

type BooksFilter struct {
	Page    int
	PerPage int
	Title   string
	Author  string
}

type MockRepoBook

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

MockRepoBook is a mock of RepoBook interface.

func NewMockRepoBook

func NewMockRepoBook(ctrl *gomock.Controller) *MockRepoBook

NewMockRepoBook creates a new mock instance.

func (*MockRepoBook) Create

func (m *MockRepoBook) Create(ctx context.Context, book NewBook) (string, error)

Create mocks base method.

func (*MockRepoBook) Delete

func (m *MockRepoBook) Delete(ctx context.Context, bookID string) error

Delete mocks base method.

func (*MockRepoBook) EXPECT

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

func (*MockRepoBook) Read

func (m *MockRepoBook) Read(ctx context.Context, bookID string) (BookDetails, error)

Read mocks base method.

func (*MockRepoBook) ReadBooks

func (m *MockRepoBook) ReadBooks(ctx context.Context, bookFilter BooksFilter) ([]BookDetails, error)

ReadBooks mocks base method.

func (*MockRepoBook) Update

func (m *MockRepoBook) Update(ctx context.Context, bookID string, book UpdateBookDetails) error

Update mocks base method.

type MockRepoBookMockRecorder

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

MockRepoBookMockRecorder is the mock recorder for MockRepoBook.

func (*MockRepoBookMockRecorder) Create

func (mr *MockRepoBookMockRecorder) Create(ctx, book interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockRepoBookMockRecorder) Delete

func (mr *MockRepoBookMockRecorder) Delete(ctx, bookID interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockRepoBookMockRecorder) Read

func (mr *MockRepoBookMockRecorder) Read(ctx, bookID interface{}) *gomock.Call

Read indicates an expected call of Read.

func (*MockRepoBookMockRecorder) ReadBooks

func (mr *MockRepoBookMockRecorder) ReadBooks(ctx, bookFilter interface{}) *gomock.Call

ReadBooks indicates an expected call of ReadBooks.

func (*MockRepoBookMockRecorder) Update

func (mr *MockRepoBookMockRecorder) Update(ctx, bookID, book interface{}) *gomock.Call

Update indicates an expected call of Update.

type NewBook

type NewBook struct {
	Title  string
	Author string
	Pages  int
}

type RepoBook

type RepoBook interface {
	Create(ctx context.Context, book NewBook) (string, error)
	Read(ctx context.Context, bookID string) (BookDetails, error)
	ReadBooks(ctx context.Context, bookFilter BooksFilter) ([]BookDetails, error)
	Update(ctx context.Context, bookID string, book UpdateBookDetails) error
	Delete(ctx context.Context, bookID string) error
}

func NewBookRepository

func NewBookRepository(dbName string) RepoBook

type UpdateBookDetails

type UpdateBookDetails struct {
	Title  *string
	Author *string
	Pages  *int
}

Jump to

Keyboard shortcuts

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