dbrepo

package
v0.9.21 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package dbrepo is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// BookTableName is table name for books entity
	BookTableName = "books"
	// BookTable is columns for books entity
	BookTable = struct {
		ID        string
		Title     string
		Author    string
		UpdatedAt string
		CreatedAt string
	}{
		ID:        "id",
		Title:     "title",
		Author:    "author",
		UpdatedAt: "updated_at",
		CreatedAt: "created_at",
	}
)

Functions

This section is empty.

Types

type BookRepo

BookRepo to get books data from database

func NewBookRepo

func NewBookRepo(impl BookRepoImpl) BookRepo

NewBookRepo return new instance of BookRepo

type BookRepoImpl

type BookRepoImpl struct {
	dig.In
	*sql.DB `name:"pg"`
}

BookRepoImpl is implementation books repository

func (*BookRepoImpl) BulkInsert added in v0.9.18

func (r *BookRepoImpl) BulkInsert(ctx context.Context, ents ...*entity.Book) (int64, error)

BulkInsert books and return affected rows

func (*BookRepoImpl) Count

func (r *BookRepoImpl) Count(ctx context.Context, opts ...sqkit.SelectOption) (int64, error)

Count books

func (*BookRepoImpl) Delete

func (r *BookRepoImpl) Delete(ctx context.Context, opt sqkit.DeleteOption) (int64, error)

Delete books

func (*BookRepoImpl) Find

func (r *BookRepoImpl) Find(ctx context.Context, opts ...sqkit.SelectOption) (list []*entity.Book, err error)

Find books

func (*BookRepoImpl) Insert

func (r *BookRepoImpl) Insert(ctx context.Context, ent *entity.Book) (int64, error)

Insert books and return last inserted id

func (*BookRepoImpl) Patch

func (r *BookRepoImpl) Patch(ctx context.Context, ent *entity.Book, opt sqkit.UpdateOption) (int64, error)

Patch books

func (*BookRepoImpl) Update

func (r *BookRepoImpl) Update(ctx context.Context, ent *entity.Book, opt sqkit.UpdateOption) (int64, error)

Update books

type MockBookRepo added in v0.9.21

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

MockBookRepo is a mock of BookRepo interface

func NewMockBookRepo added in v0.9.21

func NewMockBookRepo(ctrl *gomock.Controller) *MockBookRepo

NewMockBookRepo creates a new mock instance

func (*MockBookRepo) BulkInsert added in v0.9.21

func (m *MockBookRepo) BulkInsert(arg0 context.Context, arg1 ...*entity.Book) (int64, error)

BulkInsert mocks base method

func (*MockBookRepo) Count added in v0.9.21

func (m *MockBookRepo) Count(arg0 context.Context, arg1 ...sqkit.SelectOption) (int64, error)

Count mocks base method

func (*MockBookRepo) Delete added in v0.9.21

func (m *MockBookRepo) Delete(arg0 context.Context, arg1 sqkit.DeleteOption) (int64, error)

Delete mocks base method

func (*MockBookRepo) EXPECT added in v0.9.21

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

func (*MockBookRepo) Find added in v0.9.21

func (m *MockBookRepo) Find(arg0 context.Context, arg1 ...sqkit.SelectOption) ([]*entity.Book, error)

Find mocks base method

func (*MockBookRepo) Insert added in v0.9.21

func (m *MockBookRepo) Insert(arg0 context.Context, arg1 *entity.Book) (int64, error)

Insert mocks base method

func (*MockBookRepo) Patch added in v0.9.21

func (m *MockBookRepo) Patch(arg0 context.Context, arg1 *entity.Book, arg2 sqkit.UpdateOption) (int64, error)

Patch mocks base method

func (*MockBookRepo) Update added in v0.9.21

func (m *MockBookRepo) Update(arg0 context.Context, arg1 *entity.Book, arg2 sqkit.UpdateOption) (int64, error)

Update mocks base method

type MockBookRepoMockRecorder added in v0.9.21

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

MockBookRepoMockRecorder is the mock recorder for MockBookRepo

func (*MockBookRepoMockRecorder) BulkInsert added in v0.9.21

func (mr *MockBookRepoMockRecorder) BulkInsert(arg0 interface{}, arg1 ...interface{}) *gomock.Call

BulkInsert indicates an expected call of BulkInsert

func (*MockBookRepoMockRecorder) Count added in v0.9.21

func (mr *MockBookRepoMockRecorder) Count(arg0 interface{}, arg1 ...interface{}) *gomock.Call

Count indicates an expected call of Count

func (*MockBookRepoMockRecorder) Delete added in v0.9.21

func (mr *MockBookRepoMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call

Delete indicates an expected call of Delete

func (*MockBookRepoMockRecorder) Find added in v0.9.21

func (mr *MockBookRepoMockRecorder) Find(arg0 interface{}, arg1 ...interface{}) *gomock.Call

Find indicates an expected call of Find

func (*MockBookRepoMockRecorder) Insert added in v0.9.21

func (mr *MockBookRepoMockRecorder) Insert(arg0, arg1 interface{}) *gomock.Call

Insert indicates an expected call of Insert

func (*MockBookRepoMockRecorder) Patch added in v0.9.21

func (mr *MockBookRepoMockRecorder) Patch(arg0, arg1, arg2 interface{}) *gomock.Call

Patch indicates an expected call of Patch

func (*MockBookRepoMockRecorder) Update added in v0.9.21

func (mr *MockBookRepoMockRecorder) Update(arg0, arg1, arg2 interface{}) *gomock.Call

Update indicates an expected call of Update

Jump to

Keyboard shortcuts

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